summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorAndy Maloney <asmaloney@gmail.com>2022-12-27 09:03:18 -0500
committerAndy Maloney <asmaloney@gmail.com>2022-12-27 09:03:18 -0500
commitc3d84ce57f5012359d9716887953edb9c86880f5 (patch)
tree5686582eef967485419326e4a14cb75541a93414 /editor
parentb6e06038f8a373f7fb8d26e92d5f06887e459598 (diff)
Fix crash in SceneImportSettings::_select when a mesh has a null mesh_node
Diffstat (limited to 'editor')
-rw-r--r--editor/import/scene_import_settings.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/editor/import/scene_import_settings.cpp b/editor/import/scene_import_settings.cpp
index 380a4e370c..e543280408 100644
--- a/editor/import/scene_import_settings.cpp
+++ b/editor/import/scene_import_settings.cpp
@@ -703,15 +703,17 @@ void SceneImportSettings::_select(Tree *p_from, String p_type, String p_id) {
}
MeshData &md = mesh_map[p_id];
- if (p_from != mesh_tree) {
- md.mesh_node->uncollapse_tree();
- md.mesh_node->select(0);
- mesh_tree->ensure_cursor_is_visible();
- }
- if (p_from != scene_tree) {
- md.scene_node->uncollapse_tree();
- md.scene_node->select(0);
- scene_tree->ensure_cursor_is_visible();
+ if (md.mesh_node != nullptr) {
+ if (p_from != mesh_tree) {
+ md.mesh_node->uncollapse_tree();
+ md.mesh_node->select(0);
+ mesh_tree->ensure_cursor_is_visible();
+ }
+ if (p_from != scene_tree) {
+ md.scene_node->uncollapse_tree();
+ md.scene_node->select(0);
+ scene_tree->ensure_cursor_is_visible();
+ }
}
mesh_preview->set_mesh(md.mesh);