diff --git a/ets2panda/checker/ETSAnalyzer.cpp b/ets2panda/checker/ETSAnalyzer.cpp index f58ba747b64f0be0bbeca3d05fd5b524c4e042c2..ae055b3a2321b795b287056a608a7efcab0de341 100644 --- a/ets2panda/checker/ETSAnalyzer.cpp +++ b/ets2panda/checker/ETSAnalyzer.cpp @@ -3123,8 +3123,10 @@ checker::Type *ETSAnalyzer::Check(ir::ImportNamespaceSpecifier *st) const ES2PANDA_UNREACHABLE(); } - auto topScopeCtx = - varbinder::TopScopeContext(checker->VarBinder(), importDecl->Parent()->AsETSModule()->Scope()->AsGlobalScope()); + if (importDecl->Parent() != nullptr) { + auto topScopeCtx = varbinder::TopScopeContext(checker->VarBinder(), + importDecl->Parent()->AsETSModule()->Scope()->AsGlobalScope()); + } if (importDecl->IsPureDynamic()) { auto *type = checker->GetImportSpecifierObjectType(importDecl, st->Local()->AsIdentifier())->AsETSObjectType();