Merge pull request #42936 from timothyqiu/error-return

3.2: Fixes crash after using enums in export variables
This commit is contained in:
Rémi Verschelde 2020-10-20 15:07:29 +02:00 committed by GitHub
commit da4f778410
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4630,6 +4630,7 @@ void GDScriptParser::_parse_class(ClassNode *p_class) {
if (subexpr->type != Node::TYPE_CONSTANT) {
current_export = PropertyInfo();
_set_error("Expected a constant expression.");
return;
}
Variant constant = static_cast<ConstantNode *>(subexpr)->value;