Skip to content

Commit 70eba54

Browse files
committed
Improve error message when _EDITOR_GET fails
1 parent 0fdb93c commit 70eba54

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

editor/settings/editor_settings.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1514,7 +1514,8 @@ Variant _EDITOR_DEF(const String &p_setting, const Variant &p_default, bool p_re
15141514
}
15151515

15161516
Variant _EDITOR_GET(const String &p_setting) {
1517-
ERR_FAIL_COND_V(!EditorSettings::get_singleton() || !EditorSettings::get_singleton()->has_setting(p_setting), Variant());
1517+
ERR_FAIL_NULL_V_MSG(EditorSettings::get_singleton(), Variant(), vformat(R"(EditorSettings not instantiated yet when getting setting "%s".)", p_setting));
1518+
ERR_FAIL_COND_V_MSG(!EditorSettings::get_singleton()->has_setting(p_setting), Variant(), vformat(R"(Editor setting "%s" does not exist.)", p_setting));
15181519
return EditorSettings::get_singleton()->get_setting(p_setting);
15191520
}
15201521

0 commit comments

Comments
 (0)