Revision: 49258
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49258
Author:   campbellbarton
Date:     2012-07-26 16:55:34 +0000 (Thu, 26 Jul 2012)
Log Message:
-----------
fix for crash when displaying the tooltip for a non python menu (was introduced 
with recent translation/ui edits)

Modified Paths:
--------------
    trunk/blender/source/blender/editors/interface/interface.c

Modified: trunk/blender/source/blender/editors/interface/interface.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface.c  2012-07-26 
16:12:41 UTC (rev 49257)
+++ trunk/blender/source/blender/editors/interface/interface.c  2012-07-26 
16:55:34 UTC (rev 49258)
@@ -3735,6 +3735,7 @@
                        else
                                type = BUT_GET_RNA_TIP; /* Fail-safe 
solution... */
                }
+
                if (type == BUT_GET_RNAPROP_IDENTIFIER) {
                        if (but->rnaprop)
                                tmp = 
BLI_strdup(RNA_property_identifier(but->rnaprop));
@@ -3772,12 +3773,15 @@
                        else if (ELEM(but->type, MENU, PULLDOWN)) {
                                MenuType *mt = uiButGetMenuType(but);
                                if (mt) {
-                                       if (type == BUT_GET_RNA_LABEL)
-                                               tmp = 
BLI_strdup(RNA_struct_ui_name(mt->ext.srna));
-                                       else {
-                                               const char *t = 
RNA_struct_ui_description(mt->ext.srna);
-                                               if (t && t[0])
-                                                       tmp = BLI_strdup(t);
+                                       /* not all menus are from python */
+                                       if (mt->ext.srna) {
+                                               if (type == BUT_GET_RNA_LABEL)
+                                                       tmp = 
BLI_strdup(RNA_struct_ui_name(mt->ext.srna));
+                                               else {
+                                                       const char *t = 
RNA_struct_ui_description(mt->ext.srna);
+                                                       if (t && t[0])
+                                                               tmp = 
BLI_strdup(t);
+                                               }
                                        }
                                }
                        }

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to