Skip to content

Commit cf561b6

Browse files
committed
fix: possible undefined value
1 parent ba06a36 commit cf561b6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/parser/serializer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -726,8 +726,8 @@ export function serializeInto(
726726
if (done) continue;
727727

728728
// Get the entry values
729-
const key = entry.value[0];
730-
let value = entry.value[1];
729+
const key = entry.value ? entry.value[0] : undefined;
730+
let value = entry.value ? entry.value[1] : undefined;
731731

732732
if (typeof value?.toBSON === 'function') {
733733
value = value.toBSON();

0 commit comments

Comments
 (0)