Skip to content

Commit 7469b1a

Browse files
author
Mateusz Puczynski
committed
rename variable
1 parent 2c2923e commit 7469b1a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/validate.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -179,26 +179,26 @@ export default function validateFormData(
179179
formerMetaSchema = additionalMetaSchemas;
180180
}
181181

182-
let validationErrors = null;
182+
let validationError = null;
183183
try {
184184
ajv.validate(schema, formData);
185185
} catch (err) {
186-
validationErrors = err;
186+
validationError = err;
187187
}
188+
188189
let errors = transformAjvErrors(ajv.errors);
190+
// Clear errors to prevent persistent errors, see #1104
189191

190-
if (validationErrors && validationErrors.message) {
192+
ajv.errors = null;
193+
if (validationError && validationError.message) {
191194
errors = [
192195
...errors,
193196
{
194-
stack: validationErrors.message,
197+
stack: validationError.message,
195198
},
196199
];
197200
}
198201

199-
// Clear errors to prevent persistent errors, see #1104
200-
ajv.errors = null;
201-
202202
if (typeof transformErrors === "function") {
203203
errors = transformErrors(errors);
204204
}

0 commit comments

Comments
 (0)