diff --git a/src/debug/debug-scopes.cc b/src/debug/debug-scopes.cc index 36fe7de161..6766b2349a 100644 --- a/src/debug/debug-scopes.cc +++ b/src/debug/debug-scopes.cc @@ -650,7 +650,9 @@ bool ScopeIterator::SetVariableValue(Handle name, } bool ScopeIterator::ClosureScopeHasThisReference() const { - return !closure_scope_->has_this_declaration() && + // closure_scope_ can be nullptr if parsing failed. See the TODO in + // TryParseAndRetrieveScopes. + return closure_scope_ && !closure_scope_->has_this_declaration() && closure_scope_->HasThisReference(); }