Removed sn undefined warning (#572)

This commit is contained in:
Olivia Osborn
2021-08-03 01:09:43 -04:00
committed by GitHub
parent 2cd978b335
commit 838287a16d

View File

@@ -39,7 +39,7 @@ export function createMirror(): Mirror {
map: {}, map: {},
getId(n) { getId(n) {
// if n is not a serialized INode, use -1 as its id. // if n is not a serialized INode, use -1 as its id.
if (!n.__sn) { if (!n || !n.__sn) {
return -1; return -1;
} }
return n.__sn.id; return n.__sn.id;