Skip to content

Commit daf6102

Browse files
Fixed NPE when converters are not defined in the @rest annotation
1 parent b0ef7e8 commit daf6102

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

  • AndroidAnnotations/androidannotations/src/main/java/org/androidannotations/helper

‎AndroidAnnotations/androidannotations/src/main/java/org/androidannotations/helper/ValidatorHelper.java‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -989,6 +989,12 @@ public void validateConverters(Element element, IsValid valid) {
989989
TypeMirror httpMessageConverterType = annotationHelper.typeElementFromQualifiedName(HTTP_MESSAGE_CONVERTER).asType();
990990
TypeMirror httpMessageConverterTypeErased = annotationHelper.getTypeUtils().erasure(httpMessageConverterType);
991991
List<DeclaredType> converters = annotationHelper.extractAnnotationClassArrayParameter(element, annotationHelper.getTarget(), "converters");
992+
993+
if (converters == null) {
994+
valid.invalidate();
995+
return;
996+
}
997+
992998
for (DeclaredType converterType : converters) {
993999
TypeMirror erasedConverterType = annotationHelper.getTypeUtils().erasure(converterType);
9941000
if (annotationHelper.isSubtype(erasedConverterType, httpMessageConverterTypeErased)) {

0 commit comments

Comments
 (0)