Fix T69910: crash when using a hotkey for a new or open recent file
authorPedro Reis <veryprofessionaldodo>
Fri, 4 Oct 2019 14:55:37 +0000 (16:55 +0200)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Fri, 4 Oct 2019 14:57:48 +0000 (16:57 +0200)
Differential Revision: https://developer.blender.org/D5839

source/blender/windowmanager/intern/wm_event_system.c

index 1eec08c2e7adb626dfd85456cc470eae792a8046..a744cfb8c28eb6dbbcf1826fc0dc4a52c2149298 100644 (file)
@@ -2738,7 +2738,10 @@ static int wm_handlers_do_intern(bContext *C, wmEvent *event, ListBase *handlers
         /* Clear the tool-tip whenever a key binding is handled, without this tool-tips
          * are kept when a modal operators starts (annoying but otherwise harmless). */
         if (action & WM_HANDLER_BREAK) {
-          WM_tooltip_clear(C, CTX_wm_window(C));
+          /* Window may be gone after file read. */
+          if (CTX_wm_window(C) != NULL) {
+            WM_tooltip_clear(C, CTX_wm_window(C));
+          }
         }
       }
       else if (handler_base->type == WM_HANDLER_TYPE_UI) {