title: Is there a way to get Intellij to warn me that this code may cause a NullPointerException?
body: <p>Is there a way to get Intellij to warn me that this may cause a NullPointerException? </p>
  
  <pre><code>URL resource = Main.class.getResource("blah/ha");
  System.out.println(resource.getAuthority());  //potential NPE here
  </code></pre>
  
  <p>Intellij is great at warning me about stupid things I'm doing.  Is there a way it can warn me about the potential NPE here?  </p>
  
  <p>Please be aware that <strong><code>getResources</code> does not have any of those null/notnull annotations on it</strong>.  At least not in JDK 1.7 which is what I'm using.</p>