From 98ed9cda0555af3d3458cf6901de50b45ba015d5 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Mon, 19 Dec 2011 19:41:55 +0100 Subject: [PATCH] getProjectName() returns @NotNull (WI-9030) --- .../com/intellij/ide/RecentProjectsManagerBase.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/ide/RecentProjectsManagerBase.java b/platform/platform-impl/src/com/intellij/ide/RecentProjectsManagerBase.java index df752f1c2449..091162cb8a81 100644 --- a/platform/platform-impl/src/com/intellij/ide/RecentProjectsManagerBase.java +++ b/platform/platform-impl/src/com/intellij/ide/RecentProjectsManagerBase.java @@ -158,6 +158,9 @@ public abstract class RecentProjectsManagerBase implements PersistentStateCompon final List paths = new ArrayList(); synchronized (myState) { outer: for (String recentPath : myState.recentPaths) { + if (recentPath == null) { + continue; + } for (Project openProject : openProjects) { final String path = getProjectPath(openProject); @@ -269,7 +272,7 @@ public abstract class RecentProjectsManagerBase implements PersistentStateCompon } } - @Nullable + @NotNull private static String getProjectName(String path) { final File file = new File(path); if (file.isDirectory()) { @@ -294,14 +297,12 @@ public abstract class RecentProjectsManagerBase implements PersistentStateCompon } } } - } else { - return file.getName(); } - } else { + return file.getName(); + } + else { return FileUtil.getNameWithoutExtension(file.getName()); } - - return null; } private class MyAppLifecycleListener extends AppLifecycleListener.Adapter {