Page MenuHome

Crash when creating a new object
Closed, ResolvedPublic

Description

System Information
Operating system: Windows-10-10.0.19043-SP0 64 Bits
Graphics card: NVIDIA GeForce GTX 1070/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 472.47

Blender Version
Broken: version: 3.1.0 Alpha, branch: master
Caused by rB01df48a98394: Refactor: Port spreadsheet data set to UI tree view

Short description of error
Crash when a new object is created with a spreadsheet view visible.

Exact steps for others to reproduce the error

  • Open Blender
  • Delete default Cube
  • Go to the Geometry Nodes workspace
  • Create a new object in the 3d view

Event Timeline

It seems the tree view code assumes there is always an old tree view around to retrieve the state from. That makes sense for the asset browser where it has been used so far, but I don't think it makes sense for the spreadsheet:

This is how I would expect to fix the issue:

diff --git a/source/blender/editors/interface/tree_view.cc b/source/blender/editors/interface/tree_view.cc
index e9d68a734d2..5fcf78dd565 100644
--- a/source/blender/editors/interface/tree_view.cc
+++ b/source/blender/editors/interface/tree_view.cc
@@ -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);

However, the issue is also fixed by adding a poll function to the panel to make sure the old uiBlock never existed in the first place (which also makes the reconstruction not run, just in a different way).

I don't think the data set region panel should require a poll function necessarily, so I'll submit the above as a patch.