Fix T93250: Crash in spreadsheet tree view after recent commit

It seems that update_from_old assumed there would be an old
tree view available in the old block. This works for the asset browser
because the tree is always drawn, but for the spreadsheet that depends
on having an active object, which isn't necessarily always true.

Differential Revision: https://developer.blender.org/D13301
This commit is contained in:
Hans Goudey 2021-11-22 08:47:02 -05:00
parent 7e8f9213e9
commit 77ddc6e350
Notes: blender-bot 2023-02-14 06:17:14 +01:00
Referenced by issue #93250, Crash when creating a new object
1 changed files with 4 additions and 1 deletions

View File

@ -111,7 +111,10 @@ void AbstractTreeView::update_from_old(uiBlock &new_block)
uiTreeViewHandle *old_view_handle = ui_block_view_find_matching_in_old_block(
&new_block, reinterpret_cast<uiTreeViewHandle *>(this));
BLI_assert(old_view_handle);
if (old_view_handle == nullptr) {
is_reconstructed_ = true;
return;
}
AbstractTreeView &old_view = reinterpret_cast<AbstractTreeView &>(*old_view_handle);