diff options
author | Eric Rybicki <info@ericrybicki.com> | 2019-02-26 15:17:39 +0100 |
---|---|---|
committer | Eric Rybicki <info@ericrybicki.com> | 2019-02-26 17:07:53 +0100 |
commit | c9de8a6e68f9eb9b9e8566ed72281f4c590b79a8 (patch) | |
tree | f27621f8ebd5d0f9026ab020605c1fc5ad729cd5 /modules/gdnative/nativescript | |
parent | 5eeb06ffd1bf9cc79142760c372c17cd858cbe49 (diff) |
Fix "No loader found for resource: res://" spam when NativeScript script_class_name is not empty.
fixes #26275
Diffstat (limited to 'modules/gdnative/nativescript')
-rw-r--r-- | modules/gdnative/nativescript/nativescript.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/modules/gdnative/nativescript/nativescript.cpp b/modules/gdnative/nativescript/nativescript.cpp index 9fd0a2e8ec..c2b772df85 100644 --- a/modules/gdnative/nativescript/nativescript.cpp +++ b/modules/gdnative/nativescript/nativescript.cpp @@ -1599,18 +1599,20 @@ bool NativeScriptLanguage::handles_global_class_type(const String &p_type) const } String NativeScriptLanguage::get_global_class_name(const String &p_path, String *r_base_type, String *r_icon_path) const { - Ref<NativeScript> script = ResourceLoader::load(p_path, "NativeScript"); - if (script.is_valid()) { + if (!p_path.empty()) { + Ref<NativeScript> script = ResourceLoader::load(p_path, "NativeScript"); + if (script.is_valid()) { + if (r_base_type) + *r_base_type = script->get_instance_base_type(); + if (r_icon_path) + *r_icon_path = script->get_script_class_icon_path(); + return script->get_script_class_name(); + } if (r_base_type) - *r_base_type = script->get_instance_base_type(); + *r_base_type = String(); if (r_icon_path) - *r_icon_path = script->get_script_class_icon_path(); - return script->get_script_class_name(); + *r_icon_path = String(); } - if (r_base_type) - *r_base_type = String(); - if (r_icon_path) - *r_icon_path = String(); return String(); } |