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:
authorJulian Eisel <eiseljulian@gmail.com>2019-09-03 20:50:04 +0300
committerJulian Eisel <eiseljulian@gmail.com>2019-09-03 20:51:52 +0300
commit9e3cd98529dc2f8dbb00357126d5286ee74fae1f (patch)
tree296b8dffebbe351b3b79d20a15605f15e4ab2e6b /source/blender/editors/space_file
parent0df6224d486085bbbb07e9b1dadeee9e31ce6204 (diff)
Fix T69451: Walk-select in empty directory asserts
Code assumed the '..' was there, which isn't the case any more. Just early exiting for empty directories is fine.
Diffstat (limited to 'source/blender/editors/space_file')
-rw-r--r--source/blender/editors/space_file/file_ops.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c
index bd018581d32..d738a20bf53 100644
--- a/source/blender/editors/space_file/file_ops.c
+++ b/source/blender/editors/space_file/file_ops.c
@@ -584,6 +584,11 @@ static bool file_walk_select_selection_set(bContext *C,
BLI_assert(params);
+ if (numfiles == 0) {
+ /* No files visible, nothing to do. */
+ return false;
+ }
+
if (has_selection) {
if (extend && filelist_entry_select_index_get(files, active_old, CHECK_ALL) &&
filelist_entry_select_index_get(files, active_new, CHECK_ALL)) {
@@ -692,6 +697,11 @@ static bool file_walk_select_do(bContext *C,
/* *** get all needed files for handling selection *** */
+ if (numfiles == 0) {
+ /* No files visible, nothing to do. */
+ return false;
+ }
+
if (has_selection) {
ARegion *ar = CTX_wm_region(C);
FileLayout *layout = ED_fileselect_get_layout(sfile, ar);