title: Why am I getting a NullPointerException even through a check?
body: <p>Stack trace:</p>
  
  <pre><code>java.lang.NullPointerException
      at TestSlot.isInternetExplorerAvailable(TestSlot.java:274)
      at WebProxyHtmlRendererBeta.getSingleSlotHtml(WebProxyHtmlRendererBeta.java:168)
      // the rest is irrelevant
  </code></pre>
  
  <p><strong>TestSlot#isInternetExplorerAvailable()</strong></p>
  
  <pre><code>public Boolean isInternetExplorerAvailable() {
    if (currentSession.get("isInternetExplorerAvailable") != null) // line 274
        return (Boolean) currentSession.get("isInternetExplorerAvailable");
      return false;
    }
  </code></pre>
  
  <p><code>currentSession.get(String key)</code> is a simple fetcher to fetch from a <code>HashMap&lt;String,Object&gt;</code></p>
  
  <p><strong>...getSingleSlotHtml()</strong></p>
  
  <pre><code>else if (browserName.contains(BrowserType.IE) || browserName.contains(BrowserType.IEXPLORE))
        if (!s.isInternetExplorerAvailable()) { // line 168
          htmlClass += "browserNotAvailable ";
          imgSrc = imgSrc.split(".png")[0].concat("_unavailable.png");
          title = "browser not available";
        } else { htmlClass += "browserAvailable "; }
  </code></pre>
  
  <p>The questionable thing is, is that I tested this same type of logic using this SCCEE:</p>
  
  <pre><code>public class Main {
  
      public static void main(String[] args) {
          Map&lt;String, Object&gt; settings = new HashMap&lt;String, Object&gt;();
  
          settings.put("something", true);
  
          if (settings.get("something_else") != null)
              System.out.println("it's not null");
          else
              System.out.println("it's null");
      }
  }
  </code></pre>
  
  <p>And it put out <code>"it's null"</code> which means that I can do that null check using the <code>!=</code>.  Any ideas why this wouldn't be working for me in the <code>TestSlot#isInternetExplorerAvailable</code>method?</p>