This means that you tried to access a member of something that is not there:
string s = null;
int i = s.Length;
Just fix the thing that is null. Either make it non-empty, or do a zero test first.
There is also boundary code related to Nullable<T>, generics and a general restriction new- a little unlikely (but damn it, I hit this question!).