Skip to content

Commit

Permalink
Merge pull request godotengine#90559 from Rindbee/fix-crash-when-drag…
Browse files Browse the repository at this point in the history
…-scene-file-to-screen

Fix crash when dragging scene files to 2D/3D screen
  • Loading branch information
akien-mga committed Apr 12, 2024
2 parents cabb3ca + 4ff5326 commit 30e7178
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion editor/plugins/canvas_item_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion editor/plugins/node_3d_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 30e7178

Please sign in to comment.