From 4f9ca00294e99f9fa02ed6ea86b124c396d12eff Mon Sep 17 00:00:00 2001 From: "Wilson E. Alvarez" Date: Mon, 27 Jul 2020 23:05:34 -0400 Subject: [PATCH] Check if global class file still exists before registering it (cherry picked from commit e264ae20d2a828201a50868b3af334a3f8c8a37c) --- core/script_language.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/script_language.cpp b/core/script_language.cpp index 7392e7a0afc..2e8ebd40715 100644 --- a/core/script_language.cpp +++ b/core/script_language.cpp @@ -31,6 +31,7 @@ #include "script_language.h" #include "core/core_string_names.h" +#include "core/os/file_access.h" #include "core/project_settings.h" ScriptLanguage *ScriptServer::_languages[MAX_LANGUAGES]; @@ -166,7 +167,7 @@ void ScriptServer::init_languages() { for (int i = 0; i < script_classes.size(); i++) { Dictionary c = script_classes[i]; - if (!c.has("class") || !c.has("language") || !c.has("path") || !c.has("base")) + if (!c.has("class") || !c.has("language") || !c.has("path") || !FileAccess::exists(c["path"]) || !c.has("base")) continue; add_global_class(c["class"], c["base"], c["language"], c["path"]); }