Fix T56120: bad property access (from 2.8)
authorCampbell Barton <ideasman42@gmail.com>
Sun, 29 Jul 2018 02:09:00 +0000 (12:09 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 29 Jul 2018 02:09:00 +0000 (12:09 +1000)
Thanks to @brita_ for the fix.

source/blender/editors/space_file/file_panels.c

index c5350750af4fc5400c48c18bdad14d1046a60c4d..a40334098d7ce29f2fde009c776b328e00bcf4c8 100644 (file)
@@ -80,17 +80,21 @@ 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[] = {"filepath", "directory", "filename", "files"};
        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, '\0', UI_TEMPLATE_OP_PROPS_SHOW_EMPTY);
 
        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);