From c1f451b2b7dc3cad31504a9a58452e2cc8b890d4 Mon Sep 17 00:00:00 2001 From: yp9522 Date: Fri, 11 Jul 2025 14:11:36 +0800 Subject: [PATCH] fix CopyAnnotationProperties nullptr Issue:https://gitee.com/openharmony/arkcompiler_ets_frontend/issues/ICLNLW Signed-off-by: yp9522 --- ets2panda/compiler/lowering/ets/annotationCopyLowering.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ets2panda/compiler/lowering/ets/annotationCopyLowering.cpp b/ets2panda/compiler/lowering/ets/annotationCopyLowering.cpp index 7944383399..63ca3620fa 100644 --- a/ets2panda/compiler/lowering/ets/annotationCopyLowering.cpp +++ b/ets2panda/compiler/lowering/ets/annotationCopyLowering.cpp @@ -43,6 +43,9 @@ void CopyAnnotationProperties(public_lib::Context *ctx, ir::AnnotationUsage *st) st->Properties().front()->AsClassProperty()->Id()->Name() == compiler::Signatures::ANNOTATION_KEY_VALUE) { auto *param = st->Properties().front()->AsClassProperty(); auto singleField = annoDecl->Properties().front()->AsClassProperty(); + if (singleField == nullptr || singleField->TypeAnnotation() == nullptr) { + return; + } auto clone = singleField->TypeAnnotation()->Clone(ctx->Allocator(), param); param->SetTypeAnnotation(clone); return; -- Gitee