diff options
author | Julian Eisel <julian@blender.org> | 2021-08-03 13:10:26 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2021-08-03 13:25:38 +0300 |
commit | c0900a64ceeaa46a1dfd1fa19d5b57449fb7788a (patch) | |
tree | 3aa86783bf0f51fe89d45c335b9f68e183c7f5fb /source/blender/editors/space_file/file_draw.c | |
parent | b1a607ce04fecae7af4474f7b087993ec2cf8e5b (diff) |
Fix T90341: Crash opening 2.4 file with File Browser editor open
The file selection parameters (e.g. `context.space_data.params`) are
expected to be unset in certain cases. Reading 2.4 files seems to be one
of them. Hence, code using it should check it's set first. Also added an
assert to a File Browser UI template printing a message when the
parameters are unset, to help debugging the issue.
Diffstat (limited to 'source/blender/editors/space_file/file_draw.c')
-rw-r--r-- | source/blender/editors/space_file/file_draw.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c index 37a56816677..7d9b8583838 100644 --- a/source/blender/editors/space_file/file_draw.c +++ b/source/blender/editors/space_file/file_draw.c @@ -82,6 +82,9 @@ void ED_file_path_button(bScreen *screen, PointerRNA params_rna_ptr; uiBut *but; + BLI_assert_msg(params != NULL, + "File select parameters not set. The caller is expected to check this."); + RNA_pointer_create(&screen->id, &RNA_FileSelectParams, params, ¶ms_rna_ptr); /* callbacks for operator check functions */ |