Skip to content

Commit

Permalink
Prevent NPE when method type is null in FindEmptyMethods
Browse files Browse the repository at this point in the history
  • Loading branch information
timtebeek committed Oct 23, 2024
1 parent 03c04f2 commit 2192d72
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ private boolean isEmptyMethod(J.MethodDeclaration method) {

private boolean isInterfaceMethod(J.MethodDeclaration method) {
//noinspection ConstantConditions
return method.getMethodType().getDeclaringType() != null &&
return method.getMethodType() != null &&
method.getMethodType().getDeclaringType() != null &&
method.getMethodType().getDeclaringType().getKind() == JavaType.FullyQualified.Kind.Interface &&
!method.hasModifier(J.Modifier.Type.Default);
}
Expand Down

0 comments on commit 2192d72

Please sign in to comment.