Skip to content

Commit 597c374

Browse files
authored
fix error if input object was created by a null prototype (#35)
1 parent 613592f commit 597c374

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export default function diff(
5252
objKey &&
5353
newObjKey &&
5454
areObjects &&
55-
!richTypes[Object.getPrototypeOf(objKey).constructor.name] &&
55+
!richTypes[Object.getPrototypeOf(objKey)?.constructor?.name] &&
5656
(!options.cyclesFix || !_stack.includes(objKey))
5757
) {
5858
const nestedDiffs = diff(

0 commit comments

Comments
 (0)