title: C# InvalidOperationException
body: <pre><code>Nodo N;  
  
  foreach (string S in listBox_nodos.Items)  
  {  
      N = graph.getNodoName(S);  
      string comp = (string) listBox_nodos.SelectedItem;  
      if (comp == S)  
          System.Console.WriteLine(N.NAME);  
  }  
  </code></pre>
  
  <p>I get <code>InvalidOperationException</code> and the application crashes.<br>
  Can't get why. Any help? Thanks.</p>
  
  <p>EDIT: The 'N.NAME' prints! And then goes the crash.<br>
  EDIT2: I've tried to catch the Exception, the application crashes anyway.</p>