X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8d1547ef4697a49cf4f4b8f09f662705e064c416..6908078e2759d5036152e763337fe12acb2e9b89:/src/mac/carbon/window.cpp

diff --git a/src/mac/carbon/window.cpp b/src/mac/carbon/window.cpp
index 56d06a2612..9d32605485 100644
--- a/src/mac/carbon/window.cpp
+++ b/src/mac/carbon/window.cpp
@@ -2832,7 +2832,9 @@ void wxWindowMac::ClearBackground()
 void wxWindowMac::Update()
 {
 #if TARGET_API_MAC_OSX
-    MacGetTopLevelWindow()->MacPerformUpdates() ;
+    wxTopLevelWindowMac* top = MacGetTopLevelWindow();
+    if (top)
+        top->MacPerformUpdates() ;
 #else
     ::Draw1Control( m_peer->GetControlRef() ) ;
 #endif