Skip to content

Commit ba64ad5

Browse files
authored
Add null guard for AddCommentToMethod and NumberToDuration (#6834)
1 parent 835f9c4 commit ba64ad5

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

v2-migration/src/main/java/software/amazon/awssdk/v2migration/AddCommentToMethod.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ public String getDescription() {
7070

7171
@Override
7272
public TreeVisitor<?, ExecutionContext> getVisitor() {
73+
if (methodPattern == null) {
74+
return TreeVisitor.noop();
75+
}
7376
return new Visitor(methodPattern, comment);
7477
}
7578

v2-migration/src/main/java/software/amazon/awssdk/v2migration/NumberToDuration.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ public String getDescription() {
6565

6666
@Override
6767
public TreeVisitor<?, ExecutionContext> getVisitor() {
68+
if (methodPattern == null) {
69+
return TreeVisitor.noop();
70+
}
6871
return new Visitor(methodPattern, timeUnit);
6972
}
7073

0 commit comments

Comments
 (0)