KaarinGaming / PlatformerTutorial

The Unlicense
113 stars 69 forks source link

Null Pointer Exception in thread "main" #1

Closed CraigBenjamin closed 1 year ago

CraigBenjamin commented 1 year ago

Hi, I am not sure why I am getting a null pointer exception all of a sudden for the "InputStream is". My code was working fine, even after I finished episode 14. All of a sudden I start to get this error despite the fact that my code is identical. Please help! thank you.

This is the error:

/Users/craigbenjamin/Desktop/Java/IntelliJGitPull/out/production/2D-Platform-Game MainFiles.Main Exception in thread "main" java.lang.NullPointerException at Utils.LoadNSave.GetSpriteAtlas(LoadNSave.java:109) at Utils.LoadNSave.getLevelData(LoadNSave.java:120) at gamestates.Playing.(Playing.java:22) at MainFiles.Game.initializeClasses(Game.java:41) at MainFiles.Game.(Game.java:30) at MainFiles.Main.main(Main.java:12)

Process finished with exit code 1

KaarinGaming commented 1 year ago

Hey. Exception in thread "main" java.lang.NullPointerException at Utils.LoadNSave.GetSpriteAtlas(LoadNSave.java:109)

Check the line 109 in LoadNSave class since you get a nullpointer error. That means something is not initialized at that point.