Validate input in ScriptServer::register_language

This commit is contained in:
Haoyu Qiu 2022-10-08 14:12:25 +08:00
parent 18177828ad
commit 48e0688d8f

View file

@ -166,6 +166,7 @@ ScriptLanguage *ScriptServer::get_language(int p_idx) {
} }
void ScriptServer::register_language(ScriptLanguage *p_language) { void ScriptServer::register_language(ScriptLanguage *p_language) {
ERR_FAIL_NULL(p_language);
ERR_FAIL_COND(_language_count >= MAX_LANGUAGES); ERR_FAIL_COND(_language_count >= MAX_LANGUAGES);
_languages[_language_count++] = p_language; _languages[_language_count++] = p_language;
} }