Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#65 NullPointer in Element.canHandleInteraction()

Nifty_1.3
open
nobody
None
1
2013-02-06
2013-01-19
Lightbringer
No

I'm using JMonkey 3 (trunk) with the nifty 1.3.2 sources. I originally encountered this problem with the JMonkey3 RC2 and the nifty version it ships.

My architecture uses a multithreaded model, but all operations regarding scene graph operations or nifty calls are passed to JMonkey's equeue() as a Callable. Addtionally, I tried calling everything from various threads what seems to make no difference.

However, the actual problem:
After calling disable() on a Button the InputManager Thread immediately throws a NullPointer exception in Element.canHandleInput(). The member field "screen" is null. A simple NullPointer check on screen and resp. returning false fixed the problem for me. I did not investigate further though.

Discussion

  • void256
    void256
    2013-02-06

    There is no Element.canHandleInput() for me o_O

    She screen member variable is set in element.bindControls(Screen) which in turn is called when the Screen is activated for the first time.

    Although I believe that the check for null fixes your issue I don't think it fixes the actual issue which is probably related to some multithreaded issue in your case. So it would be great if you could do some further investigation!?