Browse Source

Fix gdnative config file set as null

Fixes #45997.

Setting a GDNativeLibrary config file as null or any other object but a ConfigFile will now cause an error.

(cherry picked from commit 618dd892f59be0f1d527da29b8cd904ad67bc915)
Kyle 4 years ago
parent
commit
b38a36923a
1 changed files with 1 additions and 0 deletions
  1. 1 0
      modules/gdnative/gdnative.cpp

+ 1 - 0
modules/gdnative/gdnative.cpp

@@ -148,6 +148,7 @@ void GDNativeLibrary::_get_property_list(List<PropertyInfo> *p_list) const {
 }
 
 void GDNativeLibrary::set_config_file(Ref<ConfigFile> p_config_file) {
+	ERR_FAIL_COND(p_config_file.is_null());
 
 	set_singleton(p_config_file->get_value("general", "singleton", default_singleton));
 	set_load_once(p_config_file->get_value("general", "load_once", default_load_once));