Skip to content

Commit 713b88e

Browse files
authored
Add null check to JodaTimeVisitor
Fixes #634
1 parent bb00d0a commit 713b88e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/org/openrewrite/java/migrate/joda/JodaTimeVisitor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ public Javadoc visitReference(Javadoc.Reference reference, ExecutionContext ctx)
210210
}
211211

212212
private J migrateMethodCall(MethodCall original, MethodCall updated) {
213-
if (!original.getMethodType().getDeclaringType().isAssignableFrom(JODA_CLASS_PATTERN)) {
213+
if (original.getMethodType() == null || !original.getMethodType().getDeclaringType().isAssignableFrom(JODA_CLASS_PATTERN)) {
214214
return updated; // not a joda type, no need to migrate
215215
}
216216
MethodTemplate template = AllTemplates.getTemplate(original);

0 commit comments

Comments
 (0)