From 3608b2dbdeae49ffaf478588f9bbb4863b49faf2 Mon Sep 17 00:00:00 2001 From: Ken Date: Mon, 16 Dec 2024 11:56:24 +0800 Subject: [PATCH] fix: add guard clause to ensure field is present before formatting --- src/app/modules/sgid/sgid.adapter.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/app/modules/sgid/sgid.adapter.ts b/src/app/modules/sgid/sgid.adapter.ts index 332d6fae7f..a0f11c2cd7 100644 --- a/src/app/modules/sgid/sgid.adapter.ts +++ b/src/app/modules/sgid/sgid.adapter.ts @@ -161,6 +161,9 @@ export class SGIDMyInfoData */ _formatFieldValue(attr: ExternalAttr): string | undefined { const fieldValue = this.#payload[attr] + if (!fieldValue) { + return '' + } switch (attr) { case ExternalAttr.RegisteredAddress: return formatAddress(fieldValue)