Skip to content

Commit 7a6317b

Browse files
ollwenjonesvojtechhabarta
authored andcommitted
Fix NPE in JaxrsApplicationScanner#isExcluded (#95)
Fix NPE in JaxrsApplicationScanner#isExcluded
1 parent 2bffcf2 commit 7a6317b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

typescript-generator-core/src/main/java/cz/habarta/typescript/generator/JaxrsApplicationScanner.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,16 @@ private void foundType(Type type, Class<?> usedInClass, String usedInMember) {
127127

128128
private boolean isExcluded(Type type) {
129129
final Class<?> cls = Utils.getRawClassOrNull(type);
130-
if (cls != null && isClassNameExcluded != null && isClassNameExcluded.test(cls.getName())) {
130+
if (cls == null) {
131+
return false;
132+
}
133+
if (isClassNameExcluded != null && isClassNameExcluded.test(cls.getName())) {
131134
return true;
132135
}
133-
if (cls != null && defaultExcludes.contains(cls.getName())) {
136+
if (defaultExcludes.contains(cls.getName())) {
134137
return true;
135138
}
139+
136140
for (Class<?> standardEntityClass : getStandardEntityClasses()) {
137141
if (standardEntityClass.isAssignableFrom(cls)) {
138142
return true;

0 commit comments

Comments
 (0)