From d8f6745079fd0bbd1a4bc8d518f852b3c46351bb Mon Sep 17 00:00:00 2001 From: anjiaqi Date: Sat, 6 Sep 2025 21:24:15 +0800 Subject: [PATCH] fix test-case on 0728 Issue: https://gitee.com/openharmony/arkcompiler_ets_frontend/issues/ICWQ2A Signed-off-by: anjiaqi --- ets2panda/checker/ETSAnalyzer.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ets2panda/checker/ETSAnalyzer.cpp b/ets2panda/checker/ETSAnalyzer.cpp index f58ba747b6..ae055b3a23 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(); -- Gitee