Merge pull request #42580 from aaronfranke/has-clear

Check for global script class information before clearing it
This commit is contained in:
Rémi Verschelde 2020-10-05 22:09:27 +02:00 committed by GitHub
commit 9b4399a509
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View file

@ -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);
}

View file

@ -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);
}