浏览代码

[3.2] Fix 'Parameter "assembly" is null' error

This error was normally being printed when
trying to open the project assembly while
the project was not yet built.
The error should not be printed. It's the job
of this method's caller to decide whether to
print an error or not if loading failed.
Ignacio Etcheverry 5 年之前
父节点
当前提交
bd18b2ff6a
共有 1 个文件被更改,包括 6 次插入2 次删除
  1. 6 2
      modules/mono/mono_gd/gd_mono_assembly.cpp

+ 6 - 2
modules/mono/mono_gd/gd_mono_assembly.cpp

@@ -458,7 +458,9 @@ GDMonoAssembly *GDMonoAssembly::load(const String &p_name, MonoAssemblyName *p_a
 
 	if (!assembly) {
 		assembly = _load_assembly_search(p_name, p_aname, p_refonly, p_search_dirs);
-		ERR_FAIL_NULL_V(assembly, nullptr);
+		if (!assembly) {
+			return nullptr;
+		}
 	}
 
 	GDMonoAssembly *loaded_asm = GDMono::get_singleton()->get_loaded_assembly(p_name);
@@ -481,7 +483,9 @@ GDMonoAssembly *GDMonoAssembly::load_from(const String &p_name, const String &p_
 
 	if (!assembly) {
 		assembly = _real_load_assembly_from(p_path, p_refonly);
-		ERR_FAIL_NULL_V(assembly, NULL);
+		if (!assembly) {
+			return nullptr;
+		}
 	}
 
 	GDMonoAssembly *loaded_asm = GDMono::get_singleton()->get_loaded_assembly(p_name);