title: How to compare two Hashtables
body: <p>I am developing a small RTS in C#(with XNA).</p>
  
  <p>I'm setting each unit "goto" position as the vector they should go to. Everything works fine if I don't compare the two Hashtables, but when I do, I get this "NullReferenceException was unhandled" annoying error.</p>
  
  <p>Here's the piece of code I'm getting the error on:</p>
  
  <pre><code>if (
      ((float)unit[(int)selectedunits[I+"ID"] + "posX"] != 
       (float)cgoto[(int)selectedunits[I+"ID"] + "X"])
      &amp;&amp;
      ((float)unit[(int)selectedunits[I+"ID"] + "posY"] !=
       (float)cgoto[(int)selectedunits[I+"ID"] + "Y"])
     )
  </code></pre>
  
  <p>Hopefully this is specific enough.</p>