Skip to content

Commit 8e716d8

Browse files
fix(overmind): fix rehydrate finding classes
1 parent 57d7897 commit 8e716d8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/node_modules/overmind/src/rehydrate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export const rehydrate = <T extends StateNode>(state: T, source: IMutation[] | S
7070
const pathArray = mutation.path.split(mutation.delimiter)
7171
const key = pathArray.pop() as string
7272
const target = pathArray.reduce((aggr, key) => aggr[key], state as any)
73-
const classInstance = pathArray.reduce((aggr, key) => aggr[key], classes as any)
73+
const classInstance = pathArray.reduce((aggr, key) => aggr && aggr[key], classes as any)
7474

7575
if (mutation.method === 'set') {
7676
if (typeof classInstance === 'function' && Array.isArray(mutation.args[0])) {

0 commit comments

Comments
 (0)