Skip to content

Commit

Permalink
fix: add guard clause to ensure field is present before formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
KenLSM committed Dec 16, 2024
1 parent 27a46aa commit 3608b2d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/app/modules/sgid/sgid.adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 3608b2d

Please sign in to comment.