Skip to content

Commit 0284d8e

Browse files
committed
Fixed issue with undefined id throwing error
1 parent 7ffeac5 commit 0284d8e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/core/helpers/utils.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,11 @@ export function getLayoutItem(layout: TLayout, id: string | number | undefined):
103103
if (layout === undefined) {
104104
throw new Error(ErrorMsg.INVALID_LAYOUT);
105105
}
106-
107-
if (id === undefined || id === null || id.toString().trim().length === 0 || parseInt(id.toString()) < 0) {
106+
if (id === undefined) {
107+
return undefined;
108+
}
109+
110+
if (id === null || id.toString().trim().length === 0 || parseInt(id.toString()) < 0) {
108111
throw new Error(ErrorMsg.INVALID_LAYOUT_ITEM_ID);
109112
}
110113

0 commit comments

Comments
 (0)