Fix [#20827] c26276 RMB on "clear" command in console menu crashes blender
authorMatt Ebb <matt@mke3.net>
Tue, 26 Jan 2010 10:06:22 +0000 (10:06 +0000)
committerMatt Ebb <matt@mke3.net>
Tue, 26 Jan 2010 10:06:22 +0000 (10:06 +0000)
source/blender/editors/interface/interface_handlers.c

index b4da74b46644f4d84e69a4b00cc85fa081971088..7273dc2360e7130f921618b1a39c835cd2fb0a10 100644 (file)
@@ -3664,7 +3664,10 @@ static int ui_but_menu(bContext *C, uiBut *but)
                int w = uiLayoutGetWidth(layout);
                wmKeyMap *km;
                int kmi_id= WM_key_event_operator_id(C, but->optype->idname, but->opcontext, prop, 1, &km);
-               wmKeyMapItem *kmi = WM_keymap_item_find_id(km, kmi_id);
+               wmKeyMapItem *kmi;
+               
+               if (kmi_id)
+                       kmi= WM_keymap_item_find_id(km, kmi_id);
 
                /* keyboard shortcuts */
                if ((kmi) && ISKEYBOARD(kmi->type)) {