Skip to content

Commit 5a6b669

Browse files
authored
Fix suspend/resume event firing (#4120)
1 parent 25f962b commit 5a6b669

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

CodenameOne/src/com/codename1/ui/util/EventDispatcher.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,8 @@ public CallbackClass(Object[] iPending, Object iPendingEvent) {
515515
* as an implementation detail
516516
*/
517517
public final void run() {
518-
if (!Display.getInstance().isEdt()) {
518+
// We might not be running during a suspend/resume cycle
519+
if (Display.isInitialized() && !Display.getInstance().isEdt()) {
519520
throw new IllegalStateException("This method should not be invoked by external code!");
520521
}
521522

0 commit comments

Comments
 (0)