summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2017-12-09 23:32:40 +0100
committerRémi Verschelde <rverschelde@gmail.com>2017-12-09 23:32:40 +0100
commit2b91a2059b62053aeeca368bec9c2a94bbe6f232 (patch)
tree87d1fec5ac6e7f706245c8fccd02641d1e4f9d0a /modules
parent94a573bb3987957f9d63d94a298da0c2e296c878 (diff)
GDNative: Fix warning when gdnative/singletons is missing
Diffstat (limited to 'modules')
-rw-r--r--modules/gdnative/register_types.cpp7
1 files 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<String> get_gdnative_singletons(EditorFileSystemDirectory *p_dir) {
}
static void actual_discoverer_handler() {
+
EditorFileSystemDirectory *dir = EditorFileSystem::get_singleton()->get_filesystem();
Set<String> 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();
}
}