NPE on new nUIViewDisplay(NUIID);

Hi everyone,

we have some unit tests that check whether our view layouts are correct.
For that purpose we create nUIViewDisplay instances and assert their elements.
This scheme was working for some time, but now the tests fail due to NPE on new nUIViewDisplay(id);
At some point in the creation of the view, nUIController.getScreenWidth() is called, where the canvas_interface variable is not initialized which results in NPE.
We use junit4.

Is this expected behavior?
Do we need to change the tests or the way they are executed?

Thanks,
Evgeni

Hi Evgeni,

I assume this is on the desktop using Phoney? Setting up nUI components before the CanvasInterface has been added will always be problematic. We can look to patch that functionality so it doesn’t throw an Exception, but the generated View will likely have some of its internal set up incorrectly for future real use.

Regards,

Nick.