From a607e6125edad4d2a59c9632371118cf3fca868a Mon Sep 17 00:00:00 2001 From: Caleb Richardson Date: Tue, 7 Nov 2017 14:44:46 -0800 Subject: Fix crash when converting empty scene to TileSet Closes #12708. Cherry-picked from #12732. --- editor/editor_node.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 3513126a9b..3d171b692c 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -1933,6 +1933,15 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { } break; case FILE_EXPORT_TILESET: { + //Make sure that the scene has a root before trying to convert to tileset + if (!editor_data.get_edited_scene_root()) { + current_option = -1; + accept->get_ok()->set_text(TTR("I see..")); + accept->set_text(TTR("This operation can't be done without a root node.")); + accept->popup_centered_minsize(); + break; + } + List extensions; Ref ml(memnew(TileSet)); ResourceSaver::get_recognized_extensions(ml, &extensions); -- cgit v1.2.3