diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2024-04-12 11:17:05 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-04-12 11:17:05 +0200 |
commit | 30e71782afd9a1fd35707b89511bcd1aa538f673 (patch) | |
tree | e3b34a4702db06119e6e0db65d97294b812c151f | |
parent | cabb3ca4efaead2d7b21f2e750babb7574236c73 (diff) | |
parent | 4ff5326959fa2a369ccb9663a2e5838db62f1215 (diff) | |
download | redot-engine-30e71782afd9a1fd35707b89511bcd1aa538f673.tar.gz |
Merge pull request #90559 from Rindbee/fix-crash-when-drag-scene-file-to-screen
Fix crash when dragging scene files to 2D/3D screen
-rw-r--r-- | editor/plugins/canvas_item_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/node_3d_editor_plugin.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index 41e5eee486..8d24e90cce 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -5944,7 +5944,7 @@ bool CanvasItemEditorViewport::can_drop_data(const Point2 &p_point, const Varian } Node *edited_scene = EditorNode::get_singleton()->get_edited_scene(); - if (_cyclical_dependency_exists(edited_scene->get_scene_file_path(), instantiated_scene)) { + if (edited_scene && !edited_scene->get_scene_file_path().is_empty() && _cyclical_dependency_exists(edited_scene->get_scene_file_path(), instantiated_scene)) { memdelete(instantiated_scene); can_instantiate = false; is_cyclical_dep = true; diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp index 88250ea3c3..aea3ea9700 100644 --- a/editor/plugins/node_3d_editor_plugin.cpp +++ b/editor/plugins/node_3d_editor_plugin.cpp @@ -4507,7 +4507,7 @@ bool Node3DEditorViewport::can_drop_data_fw(const Point2 &p_point, const Variant continue; } Node *edited_scene = EditorNode::get_singleton()->get_edited_scene(); - if (_cyclical_dependency_exists(edited_scene->get_scene_file_path(), instantiated_scene)) { + if (edited_scene && !edited_scene->get_scene_file_path().is_empty() && _cyclical_dependency_exists(edited_scene->get_scene_file_path(), instantiated_scene)) { memdelete(instantiated_scene); can_instantiate = false; is_cyclical_dep = true; |