GDScript: Make check for exposed classes more consistent

Some places were already checking if classes from ClassDB were exposed,
while others didn't. This makes the check more consistent to avoid
disparities which can lead to crashes.
This commit is contained in:
George Marques 2024-05-06 11:16:25 -03:00
parent 22a28e07cc
commit 501c5b0900
No known key found for this signature in database
GPG key ID: 046BD46A3201E43D
5 changed files with 18 additions and 17 deletions

View file

@ -6415,7 +6415,7 @@ void GDScriptAnalyzer::resolve_pending_lambda_bodies() {
static_context = previous_static_context;
}
bool GDScriptAnalyzer::class_exists(const StringName &p_class) const {
bool GDScriptAnalyzer::class_exists(const StringName &p_class) {
return ClassDB::class_exists(p_class) && ClassDB::is_class_exposed(p_class);
}