Skip to content

Commit b060795

Browse files
Fix NullPointerException in JAX-RS namespacing
1 parent 9246b13 commit b060795

File tree

1 file changed

+7
-5
lines changed
  • typescript-generator-core/src/main/java/cz/habarta/typescript/generator

1 file changed

+7
-5
lines changed

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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -241,11 +241,13 @@ public boolean test(String className) {
241241
}
242242

243243
public void setJaxrsNamespacingAnnotation(ClassLoader classLoader, String jaxrsNamespacingAnnotation) {
244-
final String[] split = jaxrsNamespacingAnnotation.split("#");
245-
final String className = split[0];
246-
final String elementName = split.length > 1 ? split[1] : "value";
247-
this.jaxrsNamespacingAnnotation = loadClass(classLoader, className, Annotation.class);
248-
this.jaxrsNamespacingAnnotationElement = elementName;
244+
if (jaxrsNamespacingAnnotation != null) {
245+
final String[] split = jaxrsNamespacingAnnotation.split("#");
246+
final String className = split[0];
247+
final String elementName = split.length > 1 ? split[1] : "value";
248+
this.jaxrsNamespacingAnnotation = loadClass(classLoader, className, Annotation.class);
249+
this.jaxrsNamespacingAnnotationElement = elementName;
250+
}
249251
}
250252

251253
public boolean areDefaultStringEnumsOverriddenByExtension() {

0 commit comments

Comments
 (0)