summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaleb Richardson <Caleb.Richardson@lakeland272.org>2017-11-07 14:44:46 -0800
committerRĂ©mi Verschelde <rverschelde@gmail.com>2017-11-09 18:39:29 +0100
commita607e6125edad4d2a59c9632371118cf3fca868a (patch)
tree0f5d2b4c4e8ca3f5055c87c6baddeb70bfd1af54
parent5cb1d064bc68d5e695860aa03db9d70404a15f6d (diff)
Fix crash when converting empty scene to TileSet
Closes #12708. Cherry-picked from #12732.
-rw-r--r--editor/editor_node.cpp9
1 files changed, 9 insertions, 0 deletions
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<String> extensions;
Ref<TileSet> ml(memnew(TileSet));
ResourceSaver::get_recognized_extensions(ml, &extensions);