Skip to content

Commit cd32109

Browse files
authored
Merge pull request #12 from EddyVerbruggen/master
Prevent NPE and report missing dependency instead
2 parents 0cbbd9a + 469236c commit cd32109

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

dts-generator/src/main/java/com/telerik/dts/DtsApi.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,13 @@ private List<JavaClass> getInterfaces(JavaClass classInterface) {
393393
String[] interfaceNames = classInterface.getInterfaceNames();
394394
for (String intface : interfaceNames) {
395395
JavaClass clazz1 = ClassRepo.findClass(intface);
396+
397+
// Added guard to prevent NullPointerExceptions in case libs are not provided - the dev can choose to include it and rerun the generator
398+
if (clazz1 == null) {
399+
System.out.println("ignoring definitions in missing dependency: " + intface);
400+
continue;
401+
}
402+
396403
String className = clazz1.getClassName();
397404

398405
// TODO: Pete: Hardcoded until we figure out how to go around the 'type incompatible with Object' issue

0 commit comments

Comments
 (0)