diff --git a/.changeset/wicked-lies-appear.md b/.changeset/wicked-lies-appear.md new file mode 100644 index 0000000000..616f7ec660 --- /dev/null +++ b/.changeset/wicked-lies-appear.md @@ -0,0 +1,5 @@ +--- +'@channel.io/bezier-icons': patch +--- + +Check if value is nullish in `isBezierIcon` function to block runtime error. 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) {