Fixes crash after using enums in export variables

This commit is contained in:
Haoyu Qiu 2020-10-20 18:41:41 +08:00
parent f442dc062a
commit 82900e54ea

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;