Skip to content

Commit bb37c31

Browse files
fix: undefined reset error when using $key #181
1 parent 66c1cce commit bb37c31

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/core/src/core/useRegle/root/createReactiveNestedStatus.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ export function createReactiveNestedStatus({
606606
}
607607

608608
for (const field of Object.values($fields.value)) {
609-
field.$reset(options, true);
609+
field?.$reset(options, true);
610610
}
611611

612612
if (options?.clearExternalErrors) {
@@ -621,7 +621,7 @@ export function createReactiveNestedStatus({
621621

622622
function $touch(runCommit = true, withConditions = false): void {
623623
for (const field of Object.values($fields.value)) {
624-
field.$touch(runCommit, withConditions);
624+
field?.$touch(runCommit, withConditions);
625625
}
626626
}
627627

0 commit comments

Comments
 (0)