title: NullPointerException using getSystemResource(..)
body: <p>I try building a texture class for LWJGL 3 in Java.</p>
  
  <p>My loadTexture function looks like this:</p>
  
  <pre><code>   public static Texture loadTexture(String filename) {
          int id = -1;
  
          try {
              File texture = new File(filename);
  
              if (!texture.exists()) {
                  System.err.println("File '" + filename + "' does not exist.");
                  return null;
              }
  
              // crash in following line
              InputStream stream = ClassLoader.getSystemResource(filename).openStream(); 
              PNGDecoder decoder = new PNGDecoder(stream);
  
              // Some code between here
  
              return new Texture(id, new Vector2i(decoder.getWidth(), decoder.getHeight()));
          } catch (IOException e) {
              e.printStackTrace();
              return new Texture(id, new Vector2i());
          }
      }
  </code></pre>
  
  <p>The stacktrace is following:</p>
  
  <pre><code>Exception in thread "main" java.lang.NullPointerException
      at org.citynopolisproject.graphics.Texture.loadTexture(Texture.java:49)
      at org.citynopolisproject.Game.&lt;init&gt;(Game.java:30)
      at org.citynopolisproject.Game.&lt;init&gt;(Game.java:33)
      at org.citynopolisproject.Game.main(Game.java:188)
  </code></pre>
  
  <p>The location of the file is: citynopolisproject/res/splash.png and the source file of the Texture.java (if needed) is stored in citynopolisproject/src/org/citynopolisproject/graphics.</p>
  
  <p>But I don't get why it crashes and throws a NPE.
  You have any ideas?</p>
  
  <p>Greetings</p>