summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorWill Nations <willnationsdev@gmail.com>2018-08-28 15:30:22 -0500
committerWill Nations <willnationsdev@gmail.com>2018-08-28 15:32:35 -0500
commitca14766e3ae1457a8538b8e4e72de00775dcd063 (patch)
tree6ea73045867e143d4b61e51627b9dd07a1e877d2 /editor
parentd42807371c667cc117460b01e9d1484f4418906f (diff)
Fix making _editor_icon meta during CLEAR_SCRIPT
Diffstat (limited to 'editor')
-rw-r--r--editor/scene_tree_dock.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp
index 39250ab391..3ace179f7d 100644
--- a/editor/scene_tree_dock.cpp
+++ b/editor/scene_tree_dock.cpp
@@ -400,8 +400,10 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
editor_data->get_undo_redo().add_do_method(E->get(), "set_script", empty);
editor_data->get_undo_redo().add_undo_method(E->get(), "set_script", existing);
- editor_data->get_undo_redo().add_do_method(E->get(), "set_meta", "_editor_icon", get_icon(E->get()->get_class(), "EditorIcons"));
- editor_data->get_undo_redo().add_undo_method(E->get(), "set_meta", "_editor_icon", E->get()->get_meta("_editor_icon"));
+ if (E->get()->has_meta("_editor_icon")) {
+ editor_data->get_undo_redo().add_do_method(E->get(), "set_meta", "_editor_icon", get_icon(E->get()->get_class(), "EditorIcons"));
+ editor_data->get_undo_redo().add_undo_method(E->get(), "set_meta", "_editor_icon", E->get()->get_meta("_editor_icon"));
+ }
}
}