Skip to content
This repository was archived by the owner on Aug 23, 2022. It is now read-only.

Commit 06a64b9

Browse files
committed
Adding additional check for error messages before rendering. Fixes ##309
1 parent 3d0ec2e commit 06a64b9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/components/errors-component.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class Errors extends Component {
3939

4040
if (!errors) return null;
4141

42-
return compact(map(errors, (error, key) => {
42+
const mappedErrors = compact(map(errors, (error, key) => {
4343
const message = messages[key];
4444

4545
if (error) {
@@ -54,6 +54,10 @@ class Errors extends Component {
5454

5555
return false;
5656
})).reduce((a, b) => a.concat(b), []);
57+
58+
if (!mappedErrors.length) return null;
59+
60+
return mappedErrors;
5761
}
5862

5963
renderError(message, key) {

0 commit comments

Comments
 (0)