Fix T56120: Crash on "Install Matcap, World or Camera HDRI"
authorInes Almeida <britalmeida@gmail.com>
Sat, 28 Jul 2018 20:58:33 +0000 (22:58 +0200)
committerInes Almeida <britalmeida@gmail.com>
Sat, 28 Jul 2018 20:58:33 +0000 (22:58 +0200)
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.

release/scripts/addons
release/scripts/addons_contrib
source/blender/editors/space_file/file_panels.c

index ebd058d7a6438d137522063bb3286c8acc325ca6..c87ee4d46f16d60a2e1db7514c8d5ab42c5d93df 160000 (submodule)
@@ -1 +1 @@
-Subproject commit ebd058d7a6438d137522063bb3286c8acc325ca6
+Subproject commit c87ee4d46f16d60a2e1db7514c8d5ab42c5d93df
index 474702157831f1a58bb50f5240ab8b1b02b6ba37..15b25a42783d1e516b5298d70b582fae2559ae17 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 474702157831f1a58bb50f5240ab8b1b02b6ba37
+Subproject commit 15b25a42783d1e516b5298d70b582fae2559ae17
index abe9f173b092ddd126ec24eadbde0d4ed032629a..cf8a5b9e1f251df5cc05ac1754ffdfd66710acf1 100644 (file)
@@ -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);