[Bf-blender-cvs] [705d214349e] blender2.8: Fix crash w/ template search & invalid property
Campbell Barton
noreply at git.blender.org
Mon Dec 4 06:05:08 CET 2017
Commit: 705d214349ef480e94461eb9ac0499a9f2beafc1
Author: Campbell Barton
Date: Mon Dec 4 16:17:54 2017 +1100
Branches: blender2.8
https://developer.blender.org/rB705d214349ef480e94461eb9ac0499a9f2beafc1
Fix crash w/ template search & invalid property
===================================================================
M source/blender/editors/interface/interface_templates.c
===================================================================
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index 9cc0136ebdd..2546527d43b 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -977,8 +977,10 @@ void uiTemplateSearch(
const char *newop, const char *unlinkop)
{
TemplateSearch *template_search = template_search_setup(ptr, propname, searchptr, searchpropname);
- template_search_buttons(C, layout, template_search, newop, unlinkop);
- MEM_freeN(template_search);
+ if (template_search != NULL) {
+ template_search_buttons(C, layout, template_search, newop, unlinkop);
+ MEM_freeN(template_search);
+ }
}
void uiTemplateSearchPreview(
@@ -990,13 +992,15 @@ void uiTemplateSearchPreview(
{
TemplateSearch *template_search = template_search_setup(ptr, propname, searchptr, searchpropname);
- template_search->use_previews = true;
- template_search->preview_rows = rows;
- template_search->preview_cols = cols;
+ if (template_search != NULL) {
+ template_search->use_previews = true;
+ template_search->preview_rows = rows;
+ template_search->preview_cols = cols;
- template_search_buttons(C, layout, template_search, newop, unlinkop);
+ template_search_buttons(C, layout, template_search, newop, unlinkop);
- MEM_freeN(template_search);
+ MEM_freeN(template_search);
+ }
}
/********************* RNA Path Builder Template ********************/
More information about the Bf-blender-cvs
mailing list