| Index: src/ast/scopes.cc
|
| diff --git a/src/ast/scopes.cc b/src/ast/scopes.cc
|
| index 293506e4cd5c67ef93bc10404f1d23d9d12b4223..20a29d3788d1b3e46ec6b958c45c836c6bd2ab4c 100644
|
| --- a/src/ast/scopes.cc
|
| +++ b/src/ast/scopes.cc
|
| @@ -1018,7 +1018,7 @@ bool Scope::RemoveUnresolved(VariableProxy* var) {
|
| }
|
|
|
| bool Scope::RemoveUnresolved(const AstRawString* name) {
|
| - if (unresolved_->raw_name() == name) {
|
| + if (unresolved_ != nullptr && unresolved_->raw_name() == name) {
|
| VariableProxy* removed = unresolved_;
|
| unresolved_ = unresolved_->next_unresolved();
|
| removed->set_next_unresolved(nullptr);
|
| @@ -1027,7 +1027,7 @@ bool Scope::RemoveUnresolved(const AstRawString* name) {
|
| VariableProxy* current = unresolved_;
|
| while (current != nullptr) {
|
| VariableProxy* next = current->next_unresolved();
|
| - if (next->raw_name() == name) {
|
| + if (next != nullptr && next->raw_name() == name) {
|
| current->set_next_unresolved(next->next_unresolved());
|
| next->set_next_unresolved(nullptr);
|
| return true;
|
|
|