Check for global script class information before clearing it

(cherry picked from commit 1ca501d7d4)
This commit is contained in:
Aaron Franke 2020-10-05 15:45:54 -04:00 committed by Rémi Verschelde
parent 1f87bca8fb
commit b2897f1f7b
No known key found for this signature in database
GPG Key ID: C3336907360768E1
2 changed files with 6 additions and 2 deletions

View File

@ -277,7 +277,9 @@ void ScriptServer::save_global_classes() {
} }
if (gcarr.empty()) { if (gcarr.empty()) {
if (ProjectSettings::get_singleton()->has_setting("_global_script_classes")) {
ProjectSettings::get_singleton()->clear("_global_script_classes"); ProjectSettings::get_singleton()->clear("_global_script_classes");
}
} else { } else {
ProjectSettings::get_singleton()->set("_global_script_classes", gcarr); ProjectSettings::get_singleton()->set("_global_script_classes", gcarr);
} }

View File

@ -966,7 +966,9 @@ void EditorData::script_class_save_icon_paths() {
} }
if (d.empty()) { if (d.empty()) {
if (ProjectSettings::get_singleton()->has_setting("_global_script_class_icons")) {
ProjectSettings::get_singleton()->clear("_global_script_class_icons"); ProjectSettings::get_singleton()->clear("_global_script_class_icons");
}
} else { } else {
ProjectSettings::get_singleton()->set("_global_script_class_icons", d); ProjectSettings::get_singleton()->set("_global_script_class_icons", d);
} }