Skip to content

Commit a455b18

Browse files
committed
Merge pull request ismaelga#25 from bebraw/error-class-undefined
Allow errorClass to survive undefined
2 parents 8af73e6 + a79fce3 commit a455b18

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/fields/utils/wrapped.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ var ou = require('plexus-objective');
77

88

99
var errorClass = function(errors) {
10-
return (errors === null || errors.length === 0) ? '' : 'error';
10+
if(!errors || errors.length === 0) {
11+
return '';
12+
}
13+
14+
return 'error';
1115
};
1216

1317
var makeTitle = function(description, errors) {

0 commit comments

Comments
 (0)