NPE in IdeNotificationArea.setStatus() due to null myStatusBar during unit test completion

A few users of my plugin have started to see an odd behavior recently when unit tests are completing. Basically tests that did complete successfully are reported as ignored, and in the log you can see the following stack trace:

java.lang.NullPointerException
at com.intellij.notification.impl.IdeNotificationArea.updateStatus(IdeNotificationArea.java:109)
at com.intellij.notification.impl.IdeNotificationArea.lambda$null$0(IdeNotificationArea.java:67)
at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:315)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.doRun(LaterInvocator.java:447)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.runNextEvent(LaterInvocator.java:431)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:415)

which corresponds to the following line of code:

myStatusBar.updateWidget(ID());

So obviously myStatusBar is null, though I've had users confirm that they have the IDE's status bar enabled. This seems to be happening in response to using ServiceMessageBuilder.testFinished() to tell the unit test framework that a test has completed successfully.

My plugin's code in this area hasn't changed in a long while, so I have to assume it's a change in behavior in more recent IDE builds.

Has anyone else seen this? Any idea what could be done to work around this issue?

Thanks,
Scott

Please sign in to leave a comment.