aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcelo Fernandez2018-03-03 20:46:36 -0300
committerHein-Pieter van Braam2018-04-14 20:28:13 +0200
commit8018dc6599d98e0fb603eba9332cfffd4db0ce20 (patch)
treece70b841ab84cbe8a8d14b9f301856746f80a323
parentaaed3ef5edf605136f5554159f38ffa04b9e4998 (diff)
downloadgodot-8018dc6599d98e0fb603eba9332cfffd4db0ce20.tar.gz
godot-8018dc6599d98e0fb603eba9332cfffd4db0ce20.tar.zst
godot-8018dc6599d98e0fb603eba9332cfffd4db0ce20.zip
Fix for a possible crash when a custom theme is not loaded properly
(cherry picked from commit 2f1429eb24705410bcfb1c106fe12160e444cc37)
-rw-r--r--editor/editor_themes.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp
index 096a60afa..b10f785a2 100644
--- a/editor/editor_themes.cpp
+++ b/editor/editor_themes.cpp
@@ -1139,7 +1139,9 @@ Ref<Theme> create_custom_theme(const Ref<Theme> p_theme) {
String custom_theme = EditorSettings::get_singleton()->get("interface/theme/custom_theme");
if (custom_theme != "") {
theme = ResourceLoader::load(custom_theme);
- } else {
+ }
+
+ if (!theme.is_valid()) {
theme = create_editor_theme(p_theme);
}