Skip to content

Commit e29a5ba

Browse files
authored
When traversing fields, ensure we create them as we go to avoid accessing undefined object
1 parent e0a4da2 commit e29a5ba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ObjectStateMutations.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ export function estimateAttributes(
138138
data[first] = { ...serverData[first] };
139139
let object = { ...data };
140140
for (let i = 0; i < fields.length - 1; i++) {
141-
object = object[fields[i]];
141+
object = object[fields[i]] || {};
142142
}
143143
object[last] = pendingOps[i][attr].applyTo(object[last]);
144144
} else {

0 commit comments

Comments
 (0)