Skip to content
Snippets Groups Projects
Commit 174f8de7 authored by Julian Eisel's avatar Julian Eisel Committed by Julian Eisel
Browse files

Fix #125466: Asset shelf crash when reverting a file

The `region_on_poll_success()` function wasn't called before
the region initializing function, so the asset shelf region data wasn't
set up as expected.

A proper fix was committed to main with 7fcd4e24, this is a 4.2
specific workaround that is more minimal and safe.

Pull Request: https://projects.blender.org/blender/blender/pulls/125817
parent c2c3ccb4
No related branches found
No related tags found
No related merge requests found
...@@ -331,11 +331,9 @@ void region_listen(const wmRegionListenerParams *params) ...@@ -331,11 +331,9 @@ void region_listen(const wmRegionListenerParams *params)
void region_init(wmWindowManager *wm, ARegion *region) void region_init(wmWindowManager *wm, ARegion *region)
{ {
/* Region-data should've been created by a previously called #region_before_redraw(). */ /* 4.2 LTS release specific workaround: create #RegionAssetShelf if not present yet, because of a
RegionAssetShelf *shelf_regiondata = RegionAssetShelf::get_from_asset_shelf_region(*region); * bug #region_on_poll_success() might not have been called before init yet. */
BLI_assert_msg( RegionAssetShelf *shelf_regiondata = RegionAssetShelf::ensure_from_asset_shelf_region(*region);
shelf_regiondata,
"Region-data should've been created by a previously called `region_before_redraw()`.");
AssetShelf *active_shelf = shelf_regiondata->active_shelf; AssetShelf *active_shelf = shelf_regiondata->active_shelf;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment