Browse Source

Check for null before validating again regex.

Change-Id: I7ed08f0738e581840b28851d080b06657299d55b
Reviewed-on: http://gerrit.dmdirc.com/3569
Automatic-Compile: DMDirc Build Manager
Reviewed-by: Chris Smith <chris@dmdirc.com>
changes/69/3569/2
Greg Holmes 10 years ago
parent
commit
41dcf3b4f0
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      src/com/dmdirc/util/validators/RegexStringValidator.java

+ 1
- 1
src/com/dmdirc/util/validators/RegexStringValidator.java View File

46
     /** {@inheritDoc} */
46
     /** {@inheritDoc} */
47
     @Override
47
     @Override
48
     public ValidationResponse validate(final String object) {
48
     public ValidationResponse validate(final String object) {
49
-        if (object.matches(regex)) {
49
+        if (object != null && object.matches(regex)) {
50
             return new ValidationResponse();
50
             return new ValidationResponse();
51
         } else {
51
         } else {
52
             return new ValidationResponse(failedReason);
52
             return new ValidationResponse(failedReason);

Loading…
Cancel
Save