From f93b503967dd8a197975048e32f0dbcb51f3a796 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Santilio?= Date: Thu, 15 Jul 2021 15:35:20 +0200 Subject: [PATCH] changed key check --- addons/supabase/Supabase/supabase.gd | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/addons/supabase/Supabase/supabase.gd b/addons/supabase/Supabase/supabase.gd index bea1d78..573c5c4 100644 --- a/addons/supabase/Supabase/supabase.gd +++ b/addons/supabase/Supabase/supabase.gd @@ -23,11 +23,17 @@ func _ready() -> void: # Load all config settings from ProjectSettings func load_config() -> void: - if ProjectSettings.has_setting(ENVIRONMENT_VARIABLES+"supabaseUrl"): - for key in config.keys(): - var setting : String = ProjectSettings.get_setting(ENVIRONMENT_VARIABLES+key) - config[key] = setting if setting!=null and setting!="" else config[key] - else: printerr("No configuration settings found, add them in override.cfg file.") + if config.supabaseKey != "" and config.supabaseUrl != "": + return + for key in config.keys(): + if ProjectSettings.has_setting(ENVIRONMENT_VARIABLES+key): + var value : String = ProjectSettings.get_setting(ENVIRONMENT_VARIABLES+key) + if value == "": + printerr("%s has not a valid value." % key) + else: + config[key] = value + else: + printerr("%s key is not defined." % key) header.append("apikey: %s"%[config.supabaseKey]) func load_nodes() -> void: