瀏覽代碼

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 年之前
父節點
當前提交
41dcf3b4f0
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1
    1
      src/com/dmdirc/util/validators/RegexStringValidator.java

+ 1
- 1
src/com/dmdirc/util/validators/RegexStringValidator.java 查看文件

@@ -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…
取消
儲存