File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
spring-boot-project/spring-boot/src/main/java/org/springframework/boot Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 21
21
import java .net .JarURLConnection ;
22
22
import java .net .URL ;
23
23
import java .net .URLConnection ;
24
+ import java .security .CodeSource ;
24
25
import java .util .jar .Attributes ;
25
26
import java .util .jar .Attributes .Name ;
26
27
import java .util .jar .JarFile ;
@@ -62,8 +63,12 @@ private static String determineSpringBootVersion() {
62
63
if (implementationVersion != null ) {
63
64
return implementationVersion ;
64
65
}
65
- URL codeSourceLocation = SpringBootVersion .class .getProtectionDomain ()
66
- .getCodeSource ().getLocation ();
66
+ CodeSource codeSource = SpringBootVersion .class .getProtectionDomain ()
67
+ .getCodeSource ();
68
+ if (codeSource == null ) {
69
+ return null ;
70
+ }
71
+ URL codeSourceLocation = codeSource .getLocation ();
67
72
try {
68
73
URLConnection connection = codeSourceLocation .openConnection ();
69
74
if (connection instanceof JarURLConnection ) {
You can’t perform that action at this time.
0 commit comments