Skip to content

Commit 10a89a4

Browse files
committed
Handle nullable NamedVariable type
1 parent cb6e06b commit 10a89a4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public J visitCompilationUnit(J.CompilationUnit cu, ExecutionContext ctx) {
9393

9494
@Override
9595
public J visitVariable(NamedVariable variable, ExecutionContext ctx) {
96-
if (!variable.getType().isAssignableFrom(JODA_CLASS_PATTERN)) {
96+
if (variable.getType() == null || !variable.getType().isAssignableFrom(JODA_CLASS_PATTERN)) {
9797
return super.visitVariable(variable, ctx);
9898
}
9999
// TODO: handle class variables

0 commit comments

Comments
 (0)