Skip to content

Commit c142eb4

Browse files
committed
Fix possible NullPointerException.
1 parent f8447ac commit c142eb4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

components/sbm-recipes-boot-upgrade/src/main/java/org/springframework/sbm/boot/upgrade_27_30/openrewrite/SecurityManagerUsagesFinder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public J.MethodInvocation visitMethodInvocation(J.MethodInvocation method, Execu
4444
// find System.getSecurityManager()
4545

4646
J.MethodInvocation m = super.visitMethodInvocation(method, executionContext);
47-
if("java.lang.System".equals(m.getMethodType().getDeclaringType().getFullyQualifiedName()) && "getSecurityManager".equals(m.getName().getSimpleName())) {
47+
if(m.getMethodType() != null && "java.lang.System".equals(m.getMethodType().getDeclaringType().getFullyQualifiedName()) && "getSecurityManager".equals(m.getName().getSimpleName())) {
4848
return m.withMarkers(m.getMarkers().addIfAbsent(new SearchResult(UUID.randomUUID(), "Indicator for usage for SecurityManager: calls to System.getSecurityManager()")));
4949
}
5050
return m;

0 commit comments

Comments
 (0)