diff options
author | kobewi <kobewi4e@gmail.com> | 2024-02-05 17:42:37 +0100 |
---|---|---|
committer | kobewi <kobewi4e@gmail.com> | 2024-02-05 17:42:37 +0100 |
commit | 808f4e8cb9be502060317526f887b1d31cbeb40a (patch) | |
tree | 4ee5041f68831353fe1f64be3f42e473e1eea78a /editor/editor_data.cpp | |
parent | f427d2f0d35f27273e856871f8588652632d8ac2 (diff) | |
download | redot-engine-808f4e8cb9be502060317526f887b1d31cbeb40a.tar.gz |
Check if history exists before discarding
Diffstat (limited to 'editor/editor_data.cpp')
-rw-r--r-- | editor/editor_data.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/editor/editor_data.cpp b/editor/editor_data.cpp index 786e841c21..b4cf6d8de1 100644 --- a/editor/editor_data.cpp +++ b/editor/editor_data.cpp @@ -649,7 +649,9 @@ void EditorData::remove_scene(int p_idx) { EditorNode::get_singleton()->emit_signal("scene_closed", edited_scene[p_idx].path); } - undo_redo_manager->discard_history(edited_scene[p_idx].history_id); + if (undo_redo_manager->has_history(edited_scene[p_idx].history_id)) { // Might not exist if scene failed to load. + undo_redo_manager->discard_history(edited_scene[p_idx].history_id); + } edited_scene.remove_at(p_idx); } |