[Bf-blender-cvs] [f36e91a] master: Correct crash in last commit (spacebar search)
Campbell Barton
noreply at git.blender.org
Tue Apr 21 07:19:46 CEST 2015
Commit: f36e91ad0af2aa6c474f476d0a27fd30f42d45ab
Author: Campbell Barton
Date: Tue Apr 21 15:18:16 2015 +1000
Branches: master
https://developer.blender.org/rBf36e91ad0af2aa6c474f476d0a27fd30f42d45ab
Correct crash in last commit (spacebar search)
===================================================================
M source/blender/editors/interface/interface.c
===================================================================
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index bda74bf..1e73866 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -1967,18 +1967,29 @@ static bool ui_but_icon_extra_is_visible_search_unlink(const uiBut *but)
static bool ui_but_icon_extra_is_visible_eyedropper(uiBut *but)
{
- StructRNA *type = RNA_property_pointer_type(&but->rnapoin, but->rnaprop);
- const short idcode = RNA_type_to_ID_code(type);
+ StructRNA *type;
+ short idcode;
BLI_assert(but->type == UI_BTYPE_SEARCH_MENU && (but->flag & UI_BUT_SEARCH_UNLINK));
+ if (but->rnaprop == NULL) {
+ return false;
+ }
+
+ type = RNA_property_pointer_type(&but->rnapoin, but->rnaprop);
+ idcode = RNA_type_to_ID_code(type);
+
+
return ((but->editstr == NULL) &&
(idcode == ID_OB || OB_DATA_SUPPORT_ID(idcode)));
}
uiButExtraIconType ui_but_icon_extra_get(uiBut *but)
{
- if (ui_but_icon_extra_is_visible_search_unlink(but)) {
+ if ((but->flag & UI_BUT_SEARCH_UNLINK) == 0) {
+ /* pass */
+ }
+ else if (ui_but_icon_extra_is_visible_search_unlink(but)) {
return UI_BUT_ICONEXTRA_UNLINK;
}
else if (ui_but_icon_extra_is_visible_eyedropper(but)) {
More information about the Bf-blender-cvs
mailing list