NullPointer at destroy()

Hello,
I have a problem and I can not figure out where it comes from. So I can’t give you any code but maybe one of you has an idea that helps me to find it.
Whenever I call the destroy() method of my application to close it I get the following exception:

java.lang.NullPointerException
	at com.jme3.app.Application.update(Application.java:604)
	at com.jme3.app.SimpleApplication.update(SimpleApplication.java:231)
	at tst.client.Game.update(Game.java:203)
	at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:151)
	at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:185)
	at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:228)
	at java.lang.Thread.run(Thread.java:744)

I have no gui or any other “extras” yet. I use the flyCam and do not do anything else that is unusual.
Please help me if you can!

Thank you for every try :slight_smile:

Somehow InputManager gets set to null… which we’ll have to see your code to see what you’ve done to figure out why.

P.S.: It’s like one or two clicks in the SDK to see where these errors are from an exception.

Please tell me which parts of the code you need (pasting the whole code could be a bit overwhelming). What do you mean with the one or two clicks? I am pretty new to JME, so I thank you for every tip :wink:

Okay some news… The exception does not occur when I outcomment the mapping lines in simpleInitApp()

inputManager.clearMappings();
inputManager.addMapping("close", new KeyTrigger(KeyInput.KEY_ESCAPE));

But can this really be the reason? I did the same before in another Application and had no problems.

Okay, I found it… I was directly calling destroy() instead of stop().