浏览代码

Fix crash when failing to load script from cache

PouleyKetchoupp 4 年之前
父节点
当前提交
9973bf93ed
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      modules/gdscript/gdscript_cache.cpp

+ 2 - 0
modules/gdscript/gdscript_cache.cpp

@@ -200,7 +200,9 @@ Ref<GDScript> GDScriptCache::get_full_script(const String &p_path, Error &r_erro
 	if (singleton->full_gdscript_cache.has(p_path)) {
 		return singleton->full_gdscript_cache[p_path];
 	}
+
 	Ref<GDScript> script = get_shallow_script(p_path);
+	ERR_FAIL_COND_V(script.is_null(), Ref<GDScript>());
 
 	r_error = script->load_source_code(p_path);