fix: determinePackageVersion throw exception in ide env

This commit is contained in:
tjq 2023-01-20 14:51:56 +08:00
parent 7eea92bfc7
commit 74358bca8d

View File

@ -44,7 +44,7 @@ public class JavaUtils {
}
final File file = new File(codeSourceLocation.toURI());
// idea 场景查找版本失败
if (file.isDirectory()) {
if (!file.exists() || file.isDirectory()) {
return "UNKNOWN";
}
try (JarFile jarFile = new JarFile(file)) {