From 2b91a2059b62053aeeca368bec9c2a94bbe6f232 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Sat, 9 Dec 2017 23:32:40 +0100 Subject: [PATCH] GDNative: Fix warning when gdnative/singletons is missing --- modules/gdnative/register_types.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/gdnative/register_types.cpp b/modules/gdnative/register_types.cpp index 365def75bc..20ed0dc32d 100644 --- a/modules/gdnative/register_types.cpp +++ b/modules/gdnative/register_types.cpp @@ -99,12 +99,16 @@ static Set get_gdnative_singletons(EditorFileSystemDirectory *p_dir) { } static void actual_discoverer_handler() { + EditorFileSystemDirectory *dir = EditorFileSystem::get_singleton()->get_filesystem(); Set file_paths = get_gdnative_singletons(dir); bool changed = false; - Array current_files = ProjectSettings::get_singleton()->get("gdnative/singletons"); + Array current_files; + if (ProjectSettings::get_singleton()->has_setting("gdnative/singletons") { + current_files = ProjectSettings::get_singleton()->get("gdnative/singletons"); + } Array files; files.resize(file_paths.size()); int i = 0; @@ -128,7 +132,6 @@ static void actual_discoverer_handler() { if (changed) { ProjectSettings::get_singleton()->set("gdnative/singletons", files); - ProjectSettings::get_singleton()->save(); } }