diff --git a/ets2panda/compiler/lowering/ets/annotationCopyLowering.cpp b/ets2panda/compiler/lowering/ets/annotationCopyLowering.cpp index 7944383399fa3ad4805b71f429a7ef4279eb4a6e..63ca3620fa2ba069fc1db3f366f5f2d8d2197f95 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;