mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[platform] another NPE on detecting a name of a project located in a Windows disk root
GitOrigin-RevId: 2ef104eb03cb95d985a77685c2fdce2e59572084
This commit is contained in:
committed by
intellij-monorepo-bot
parent
61335a0d91
commit
1dd5523f77
@@ -99,6 +99,12 @@ public class JpsPathUtil {
|
||||
|
||||
public static @NotNull String getDefaultProjectName(@NotNull Path projectDir) {
|
||||
Path parent = projectDir.getParent();
|
||||
return parent != null ? parent.getFileName().toString() : UNNAMED_PROJECT;
|
||||
if (parent != null) {
|
||||
Path name = parent.getFileName(); // `null` when parent is a Windows disk root
|
||||
return name != null ? name.toString() : parent.toString();
|
||||
}
|
||||
else {
|
||||
return UNNAMED_PROJECT;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user