on master help sign in
fix: 'v is undefined' and 'cannot read .length of undefined' errors when validating empty inputs
commitd955c27d97ec5eb0f258fc854d4197ff9196fb35 authorMatt Condon (shrugs) <mattgcondon@gmail.com> dateThu 8 Aug 2019, 12:00 (7 years ago) parent8587d94
1 file changed+1−1
src/lib/validators.js+1−1
src/lib/validators.js+1−1
@@ -23,7 +23,7 @@ export const validateMnemonic = v =>
2323
2424// Checks an empty field
2525export const validateNotEmpty = v =>
26− v.length === 0 && 'This field is required.';
26+ (v === undefined || v.length === 0) && 'This field is required.';
2727
2828// Checks if a patp is a valid galaxy
2929export const validateGalaxy = v => {