diff options
author | Aaron Franke <arnfranke@yahoo.com> | 2020-10-05 15:45:54 -0400 |
---|---|---|
committer | Aaron Franke <arnfranke@yahoo.com> | 2020-10-05 15:45:54 -0400 |
commit | 1ca501d7d4e6810361c0809062b570ed4702d0c8 (patch) | |
tree | 37df1d240291d55f927d5cc733afc6ece1ef4523 | |
parent | 437e0be8112a81344fd9b2474644ab8cf0b60885 (diff) |
Check for global script class information before clearing it
-rw-r--r-- | core/script_language.cpp | 4 | ||||
-rw-r--r-- | editor/editor_data.cpp | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/core/script_language.cpp b/core/script_language.cpp index bb2e9a07ff..d535c54dea 100644 --- a/core/script_language.cpp +++ b/core/script_language.cpp @@ -276,7 +276,9 @@ void ScriptServer::save_global_classes() { } if (gcarr.empty()) { - ProjectSettings::get_singleton()->clear("_global_script_classes"); + if (ProjectSettings::get_singleton()->has_setting("_global_script_classes")) { + ProjectSettings::get_singleton()->clear("_global_script_classes"); + } } else { ProjectSettings::get_singleton()->set("_global_script_classes", gcarr); } diff --git a/editor/editor_data.cpp b/editor/editor_data.cpp index 7537c86676..1002c4917b 100644 --- a/editor/editor_data.cpp +++ b/editor/editor_data.cpp @@ -937,7 +937,9 @@ void EditorData::script_class_save_icon_paths() { } if (d.empty()) { - ProjectSettings::get_singleton()->clear("_global_script_class_icons"); + if (ProjectSettings::get_singleton()->has_setting("_global_script_class_icons")) { + ProjectSettings::get_singleton()->clear("_global_script_class_icons"); + } } else { ProjectSettings::get_singleton()->set("_global_script_class_icons", d); } |