diff --git a/src/macosx/native/sun/awt/awt.m b/src/macosx/native/sun/awt/awt.m index ea684ed0808a228317c5d8ab3eda59d68fe66d3d..5e7942aa0163f6154200d5f2635986f1cfb5d3c9 100644 --- a/src/macosx/native/sun/awt/awt.m +++ b/src/macosx/native/sun/awt/awt.m @@ -316,7 +316,10 @@ AWT_ASSERT_APPKIT_THREAD; // its finishLaunching has initialized it. // ApplicationDelegate is the support code for com.apple.eawt. [ThreadUtilities performOnMainThreadWaiting:YES block:^(){ - OSXAPP_SetApplicationDelegate([ApplicationDelegate sharedDelegate]); + id delegate = [ApplicationDelegate sharedDelegate]; + if (delegate != nil) { + OSXAPP_SetApplicationDelegate(delegate); + } }]; }