Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-07-26 20:55:34 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-07-26 20:55:34 +0400
commit0c1ea1465673c27c567e83c12c5a796745912e34 (patch)
tree1a4c320ca448c0f915931ef9e4bbeb209a58b9a6 /source
parent4bfef9a4434521a7d530829e3a932b5ef74bb06f (diff)
fix for crash when displaying the tooltip for a non python menu (was introduced with recent translation/ui edits)
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/interface/interface.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index 8f15a63ac33..e588f2ade80 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -3735,6 +3735,7 @@ void uiButGetStrInfo(bContext *C, uiBut *but, int nbr, ...)
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 @@ void uiButGetStrInfo(bContext *C, uiBut *but, int nbr, ...)
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);
+ }
}
}
}