Explorar el Código

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 hace 10 años
padre
commit
41dcf3b4f0
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1
    1
      src/com/dmdirc/util/validators/RegexStringValidator.java

+ 1
- 1
src/com/dmdirc/util/validators/RegexStringValidator.java Ver fichero

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

Loading…
Cancelar
Guardar