Fix crash when opening new asset shelf by dragging

Steps to recreate were:
- Open factory startup
- Add armature, switch to Pose Mode
- Drag upwards the little triangle/chevron tab in the lower right of the
  3D View

If the asset shelf would be displayed the first time for an editor, the
asset shelf data isn't valid yet and can't be accessed.
This commit is contained in:
Julian Eisel 2023-10-23 11:47:41 +02:00
parent d2b86610f0
commit 3817c31e82
1 changed files with 3 additions and 0 deletions

View File

@ -380,6 +380,9 @@ void ED_asset_shelf_region_on_user_resize(const ARegion *region)
const RegionAssetShelf *shelf_regiondata = RegionAssetShelf::get_from_asset_shelf_region(
*region);
AssetShelf *active_shelf = shelf_regiondata->active_shelf;
if (!active_shelf) {
return;
}
const int tile_height = current_tile_draw_height(region);
active_shelf->preferred_row_count = calculate_row_count_from_tile_draw_height(