title: Check if session item exists fails itself with object reference not set error
body: <p>I'm having problem regarding session items. Before I use them, I want to check if they exists, but using this codes gives me error:</p>
  
  <pre><code>If (Session("SomeSessionItem") Is Nothing) Then
  ...
  End If
  </code></pre>
  
  <p>This is the error:</p>
  
  <blockquote>
    <p>Object reference not set to an instance of an object.</p>
  </blockquote>
  
  <p>I think <code>Session("SomeSessionItem")</code> tries to acquire the value of the session item. If the item doesn't exists then it throws exception. But how do I check if a session item exists before using them?</p>
  
  <ul>
  <li>I have a page <code>Home.aspx</code>. </li>
  <li>In the <code>Home.aspx.vb</code>, I instantiate a WebUserControl <code>SomeControl.ascx</code>. Note that in <code>Home.aspx.vb</code> event handler <code>Page_Load</code> I can use a condition to check session without getting an exception.</li>
  <li>Inside <code>SomeControl.ascx.vb</code> I'm trying to access the session, here's where the exception occurs.</li>
  </ul>