Fix a null dereference.

Fixes #486
This commit is contained in:
Michael Hansen
2024-08-06 08:20:25 -07:00
parent cb32b581ee
commit 48d1bfa59f

View File

@@ -396,7 +396,7 @@ PycRef<ASTNode> BuildFromCode(PycRef<PycCode> code, PycModule* mod)
{
// if class is a closure code, ignore this tuple
PycRef<ASTNode> tos = stack.top();
if (tos->type() == ASTNode::NODE_LOADBUILDCLASS) {
if (tos && tos->type() == ASTNode::NODE_LOADBUILDCLASS) {
break;
}