Skip to content

Commit 331579c

Browse files
committed
Fix null pointers
1 parent 94f3250 commit 331579c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/org/javawebstack/validator/Validator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public class Validator {
4747
}
4848

4949
public static void registerRuleType(String name, Class<? extends ValidationRule> type, Class<? extends Annotation> annotationClass) {
50-
if (!ruleAnnotationClasses.containsKey(type))
50+
if (!ruleAnnotationClasses.containsKey(type) && annotationClass != null)
5151
ruleAnnotationClasses.put(type, annotationClass);
5252
try {
5353
Constructor<? extends ValidationRule> constructor = type.getDeclaredConstructor(String[].class);

0 commit comments

Comments
 (0)