I'm trying to add a string from a List, to another List. After getting a NullReferenceException I tried to print out the content of the string. Its NOT Null. That's Why I cant understand why I'm getting this Exception.
foreach (string s in EntrieDatasReady)
{
if (s.Contains("["))
{
MessageBox.Show(s);
CategoryList.Add(s);
MessageBox.Show(s);
}
}
Before Crashing the application he gives me this Output:
So the Exception seems to appear when I'm trying to add the string to the List. This is not understandable to me. Because obviously "s" is not "Null".
My Code: