Skip to content

Commit

Permalink
Merge pull request #21754 from willnationsdev/fix-script-class-ns
Browse files Browse the repository at this point in the history
Fix invalid deref in NativeScript script classes
  • Loading branch information
karroffel authored Sep 4, 2018
2 parents e8a6c58 + fadf2d2 commit 93a888e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions modules/gdnative/nativescript/nativescript.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1585,12 +1585,16 @@ 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()) {
*r_base_type = script->get_instance_base_type();
*r_icon_path = script->get_script_class_icon_path();
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();
}
*r_base_type = String();
*r_icon_path = String();
if (r_base_type)
*r_base_type = String();
if (r_icon_path)
*r_icon_path = String();
return String();
}

Expand Down

0 comments on commit 93a888e

Please sign in to comment.