Fix gdnative config file set as null

Fixes #

Setting a GDNativeLibrary config file as null or any other object but a ConfigFile will now cause an error.
This commit is contained in:
Kyle 2021-03-31 15:00:31 -04:00
parent 5d0cc7c15f
commit 618dd892f5
1 changed files with 2 additions and 0 deletions

View File

@ -159,6 +159,8 @@ void GDNativeLibrary::_get_property_list(List<PropertyInfo> *p_list) const {
} }
void GDNativeLibrary::set_config_file(Ref<ConfigFile> p_config_file) { 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_singleton(p_config_file->get_value("general", "singleton", default_singleton));
set_load_once(p_config_file->get_value("general", "load_once", default_load_once)); set_load_once(p_config_file->get_value("general", "load_once", default_load_once));
set_symbol_prefix(p_config_file->get_value("general", "symbol_prefix", default_symbol_prefix)); set_symbol_prefix(p_config_file->get_value("general", "symbol_prefix", default_symbol_prefix));