From 938f50e1f74c5ae6c2b6451ca0b14396e9968cfe Mon Sep 17 00:00:00 2001 From: Harley Acheson Date: Fri, 5 Jul 2024 19:36:49 +0200 Subject: [PATCH] Fix #124168: Allow File Browser Layout Initialization While Minimized If you change an area to a File Browser while it is vertically minimized we get an assert on layout initialization since there are no visible rows. But this state is valid and it works great without this assert. This PR removes the assert and adds a comment. Pull Request: https://projects.blender.org/blender/blender/pulls/124253 --- source/blender/editors/space_file/filesel.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/blender/editors/space_file/filesel.cc b/source/blender/editors/space_file/filesel.cc index ab54d8839de..1b4dd5afa35 100644 --- a/source/blender/editors/space_file/filesel.cc +++ b/source/blender/editors/space_file/filesel.cc @@ -1099,7 +1099,9 @@ void ED_fileselect_init_layout(SpaceFile *sfile, ARegion *region) file_attribute_columns_init(params, layout); layout->rows = std::max(rowcount, numfiles); - BLI_assert(layout->rows != 0); + + /* layout->rows can be zero if a very small area is changed to a File Browser. #124168. */ + layout->height = sfile->layout->rows * (layout->tile_h + 2 * layout->tile_border_y) + layout->tile_border_y * 2 + layout->offset_top; layout->flag = FILE_LAYOUT_VER;