From d950a13c100b895809c833840f44f000cfe3adcb Mon Sep 17 00:00:00 2001 From: Ignacio Etcheverry Date: Fri, 11 Mar 2016 01:20:01 +0100 Subject: [PATCH] TileSet Export: Avoid invalid error when merge is enabled but file does not exist (cherry picked from commit 897b33ce77dee4ba22ce30aede7784eec73f9c64) --- tools/editor/editor_node.cpp | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index 69f5e170f7a..a6c1e00ad28 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -1266,23 +1266,20 @@ void EditorNode::_dialog_action(String p_file) { if (FileAccess::exists(p_file)) { ml=ResourceLoader::load(p_file,"TileSet"); - if (!file_export_lib_merge->is_pressed()) { + if (ml.is_null()) { + if (file_export_lib_merge->is_pressed()) { + current_option=-1; + //accept->get_cancel()->hide(); + accept->get_ok()->set_text("I see.."); + accept->set_text("Can't load TileSet for merging!."); + accept->popup_centered_minsize(); + return; + } + } else if (!file_export_lib_merge->is_pressed()) { ml->clear(); } - } - - if (ml.is_null()) { - - if (file_export_lib_merge->is_pressed()) { - current_option=-1; - //accept->get_cancel()->hide(); - accept->get_ok()->set_text("I see.."); - accept->set_text("Can't load TileSet for merging!."); - accept->popup_centered_minsize(); - return; - } - + } else { ml = Ref( memnew( TileSet )); }