Bugfix #26021
authorTon Roosendaal <ton@blender.org>
Fri, 11 Feb 2011 18:29:52 +0000 (18:29 +0000)
committerTon Roosendaal <ton@blender.org>
Fri, 11 Feb 2011 18:29:52 +0000 (18:29 +0000)
On certain buttons, and only when not in triple buffer, pressing
RMB "Add shortcut" crashed Blender. NULL check missing.

source/blender/editors/interface/interface_handlers.c

index b802098ff10ddc381260af9ba802ba173f61f82a..d912610637f3f59c175a377cf8efa8ef86daf91b 100644 (file)
@@ -4684,19 +4684,21 @@ static void button_timers_tooltip_remove(bContext *C, uiBut *but)
        uiHandleButtonData *data;
 
        data= but->active;
+       if(data) {
 
-       if(data->tooltiptimer) {
-               WM_event_remove_timer(data->wm, data->window, data->tooltiptimer);
-               data->tooltiptimer= NULL;
-       }
-       if(data->tooltip) {
-               ui_tooltip_free(C, data->tooltip);
-               data->tooltip= NULL;
-       }
+               if(data->tooltiptimer) {
+                       WM_event_remove_timer(data->wm, data->window, data->tooltiptimer);
+                       data->tooltiptimer= NULL;
+               }
+               if(data->tooltip) {
+                       ui_tooltip_free(C, data->tooltip);
+                       data->tooltip= NULL;
+               }
 
-       if(data->autoopentimer) {
-               WM_event_remove_timer(data->wm, data->window, data->autoopentimer);
-               data->autoopentimer= NULL;
+               if(data->autoopentimer) {
+                       WM_event_remove_timer(data->wm, data->window, data->autoopentimer);
+                       data->autoopentimer= NULL;
+               }
        }
 }