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
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2017-12-04 08:17:54 +0300
committerCampbell Barton <ideasman42@gmail.com>2017-12-04 08:19:01 +0300
commit705d214349ef480e94461eb9ac0499a9f2beafc1 (patch)
treefba184fa6ae6e432de61124168dab686feda88e2 /source/blender/editors/interface/interface_templates.c
parent09cade6ca44c7081932570d6500ee535ed7de5ef (diff)
Fix crash w/ template search & invalid property
Diffstat (limited to 'source/blender/editors/interface/interface_templates.c')
-rw-r--r--source/blender/editors/interface/interface_templates.c18
1 files changed, 11 insertions, 7 deletions
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 ********************/