Skip to content

Commit 9f1c63b

Browse files
committed
fix: make sure to have a fallback for undefined casts closes #4186
1 parent 5109100 commit 9f1c63b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/vee-validate/src/useForm.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ function resolveInitialValues<TValues extends GenericFormValues = GenericFormVal
8383
): TValues {
8484
const providedValues = unref(opts?.initialValues) || {};
8585
if (opts?.validationSchema && isTypedSchema(opts.validationSchema) && isCallable(opts.validationSchema.cast)) {
86-
return deepCopy(opts.validationSchema.cast(providedValues));
86+
return deepCopy(opts.validationSchema.cast(providedValues) || {});
8787
}
8888

8989
return deepCopy(providedValues) as TValues;

0 commit comments

Comments
 (0)