Skip to content

Commit 21e1f9f

Browse files
authored
AfterOrEqual when field to compare against is null
When using this validator to compare against another field in the model, if that field is null the validator will fail
1 parent 22e294c commit 21e1f9f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

models/validators/AfterOrEqualValidator.cfc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ component
5858
"get#arguments.validationData#"
5959
);
6060
}
61+
62+
// return true if no value to compare against
63+
if ( isNull( compareValue ) || isNullOrEmpty( compareValue ) ) {
64+
return true;
65+
}
6166

6267
/**
6368
* -1 if date1 is before than date2

0 commit comments

Comments
 (0)