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:
authorInes Almeida <britalmeida@gmail.com>2018-07-28 23:58:33 +0300
committerInes Almeida <britalmeida@gmail.com>2018-07-28 23:58:33 +0300
commitf50fa4c5d69a50fca880d1abb0b49d06d4745be8 (patch)
tree63eef488f21ea8f2e0c2fd80cae62b0f390a1df8 /source/blender/editors/space_file
parentdecd924116d778a524aae49f271f3020e8696ca4 (diff)
Fix T56120: Crash on "Install Matcap, World or Camera HDRI"
Code was trying to hide properties by name that may not exist. Check if it was actually found and add 'files' to the filter, since it is what WM_OT_studio_lights_install uses.
Diffstat (limited to 'source/blender/editors/space_file')
-rw-r--r--source/blender/editors/space_file/file_panels.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/source/blender/editors/space_file/file_panels.c b/source/blender/editors/space_file/file_panels.c
index abe9f173b09..cf8a5b9e1f2 100644
--- a/source/blender/editors/space_file/file_panels.c
+++ b/source/blender/editors/space_file/file_panels.c
@@ -80,19 +80,24 @@ static void file_panel_operator(const bContext *C, Panel *pa)
UI_block_func_set(uiLayoutGetBlock(pa->layout), file_draw_check_cb, NULL, NULL);
/* Hack: temporary hide.*/
- const char *hide[3] = {"filepath", "directory", "filename"};
+ const char *hide[4] = {"filepath", "files", "directory", "filename"};
for (int i = 0; i < ARRAY_SIZE(hide); i++) {
- PropertyRNA *prop = RNA_struct_find_property(op->ptr, "filepath");
- RNA_def_property_flag(prop, PROP_HIDDEN);
+ PropertyRNA *prop = RNA_struct_find_property(op->ptr, hide[i]);
+ if (prop) {
+ RNA_def_property_flag(prop, PROP_HIDDEN);
+ }
}
uiTemplateOperatorPropertyButs(
C, pa->layout, op, UI_BUT_LABEL_ALIGN_NONE,
UI_TEMPLATE_OP_PROPS_SHOW_EMPTY);
+ /* Hack: temporary hide.*/
for (int i = 0; i < ARRAY_SIZE(hide); i++) {
- PropertyRNA *prop = RNA_struct_find_property(op->ptr, "filepath");
- RNA_def_property_clear_flag(prop, PROP_HIDDEN);
+ PropertyRNA *prop = RNA_struct_find_property(op->ptr, hide[i]);
+ if (prop) {
+ RNA_def_property_clear_flag(prop, PROP_HIDDEN);
+ }
}
UI_block_func_set(uiLayoutGetBlock(pa->layout), NULL, NULL, NULL);