From 89b7e45c73346bcb67562ee71d697033a6690c0a Mon Sep 17 00:00:00 2001 From: andrew Date: Fri, 12 Jul 2024 16:25:59 +0900 Subject: [PATCH 1/3] feat(bezier-icons): prevent NPE error with isBezierIcon --- packages/bezier-icons/utils/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/bezier-icons/utils/index.ts b/packages/bezier-icons/utils/index.ts index 3a298ed02c..53e8d0cb4c 100644 --- a/packages/bezier-icons/utils/index.ts +++ b/packages/bezier-icons/utils/index.ts @@ -6,7 +6,7 @@ const BEZIER_ICON_ID = '__bezier__icon' export function isBezierIcon(arg: any) { - return typeof arg === 'object' && arg[BEZIER_ICON_ID] === true + return !!arg && typeof arg === 'object' && arg[BEZIER_ICON_ID] === true } export function createBezierIcon(source: any) { From af82845d08beab291f4cd9fdc6892c8dc2ad9fc9 Mon Sep 17 00:00:00 2001 From: andrew Date: Fri, 12 Jul 2024 16:27:18 +0900 Subject: [PATCH 2/3] chore(changeset): add --- .changeset/wicked-lies-appear.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/wicked-lies-appear.md diff --git a/.changeset/wicked-lies-appear.md b/.changeset/wicked-lies-appear.md new file mode 100644 index 0000000000..93eb2a7260 --- /dev/null +++ b/.changeset/wicked-lies-appear.md @@ -0,0 +1,5 @@ +--- +'@channel.io/bezier-icons': patch +--- + +check nullish in isBezierIcon to block NPE error From ddcdeb979194f7ffa53febd603e5afcca3cea2a4 Mon Sep 17 00:00:00 2001 From: andrew Date: Fri, 12 Jul 2024 16:38:12 +0900 Subject: [PATCH 3/3] chore(changeset): modify changeest --- .changeset/wicked-lies-appear.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/wicked-lies-appear.md b/.changeset/wicked-lies-appear.md index 93eb2a7260..616f7ec660 100644 --- a/.changeset/wicked-lies-appear.md +++ b/.changeset/wicked-lies-appear.md @@ -2,4 +2,4 @@ '@channel.io/bezier-icons': patch --- -check nullish in isBezierIcon to block NPE error +Check if value is nullish in `isBezierIcon` function to block runtime error.