summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-08-16 22:06:29 +0200
committerGitHub <noreply@github.com>2020-08-16 22:06:29 +0200
commit75e2a405d008d6ee6455079ba37b6a6202c5f932 (patch)
tree697a2313e344bf294fc1a67851e2fb0e71d39dd5 /scene
parent87ae509905e6a4388588472b4edddb791aec56a4 (diff)
parent6f426c3360595593294d910471f3c30407bbd38f (diff)
Merge pull request #40980 from Xrayez/port-classdb-tests
Port ClassDB tests to use doctest
Diffstat (limited to 'scene')
-rw-r--r--scene/register_scene_types.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/scene/register_scene_types.cpp b/scene/register_scene_types.cpp
index 47b8b6073b..996d249bbf 100644
--- a/scene/register_scene_types.cpp
+++ b/scene/register_scene_types.cpp
@@ -372,7 +372,11 @@ void register_scene_types() {
OS::get_singleton()->yield(); //may take time to init
- AcceptDialog::set_swap_cancel_ok(GLOBAL_DEF_NOVAL("gui/common/swap_cancel_ok", bool(DisplayServer::get_singleton()->get_swap_cancel_ok())));
+ bool swap_cancel_ok = false;
+ if (DisplayServer::get_singleton()) {
+ swap_cancel_ok = GLOBAL_DEF_NOVAL("gui/common/swap_cancel_ok", bool(DisplayServer::get_singleton()->get_swap_cancel_ok()));
+ }
+ AcceptDialog::set_swap_cancel_ok(swap_cancel_ok);
#endif
/* REGISTER 3D */
@@ -912,8 +916,10 @@ void register_scene_types() {
}
}
- // Always make the default theme to avoid invalid default font/icon/style in the given theme
- make_default_theme(default_theme_hidpi, font);
+ // Always make the default theme to avoid invalid default font/icon/style in the given theme.
+ if (RenderingServer::get_singleton()) {
+ make_default_theme(default_theme_hidpi, font);
+ }
if (theme_path != String()) {
Ref<Theme> theme = ResourceLoader::load(theme_path);