I have searched and searched for a solution to this problem, but it seems no-one else is experiencing it. Here’s a description:
I’m creating a tile-based game with some co-programmers. We use a database class to do any and all loading of files and images. Everything works out just wonderfully until my Mac suddenly throws a NullPointerException at my face. The weird thing is it works on another dude’s Mac (same model and everything) and it worked just fine on my computer a few minutes before the error. Nothing has been changed in the meantime.
This has happened before, and back then I re-installed the OS which sorted the problem, so it sounds like a tweak in either Eclipse (which I’m using as IDE) or MacOS. Anyone got any ideas?
The project can be found on:
https://github.com/Gadamagaska/Quantum-Man
My stack-trace:
Exception in thread "main" java.lang.NullPointerException
at entities.Level.getTile(Level.java:24)
at database.Database.getTile(Database.java:206)
at core.FoffyMain.drawBottomTiles(FoffyMain.java:82)
at core.FoffyMain.draw(FoffyMain.java:64)
at core.Core.gameLoop(Core.java:58)
at core.Core.run(Core.java:34)
at core.FoffyMain.main(FoffyMain.java:28)
you could have checks like this
or simple handle the null pointer exception