From 3ffe34f2de146ae6bdfb809effd6ceae3073cd3b Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Mon, 20 Jan 2014 15:00:58 +0100 Subject: [PATCH] fix java.lang.NullPointerException at com.intellij.ide.browsers.StartBrowserPanel$3.chosenFileToResultingText(StartBrowserPanel.java:143) --- xml/impl/src/com/intellij/ide/browsers/StartBrowserPanel.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xml/impl/src/com/intellij/ide/browsers/StartBrowserPanel.java b/xml/impl/src/com/intellij/ide/browsers/StartBrowserPanel.java index fed8cdb950ba..9b93096aaf63 100644 --- a/xml/impl/src/com/intellij/ide/browsers/StartBrowserPanel.java +++ b/xml/impl/src/com/intellij/ide/browsers/StartBrowserPanel.java @@ -111,6 +111,7 @@ public class StartBrowserPanel { } } + @Nullable private static Url virtualFileToUrl(VirtualFile file, Project project) { PsiFile psiFile; AccessToken token = ReadAction.start(); @@ -139,7 +140,8 @@ public class StartBrowserPanel { @NotNull @Override protected String chosenFileToResultingText(@NotNull VirtualFile chosenFile) { - return virtualFileToUrl(chosenFile, project).toDecodedForm(); + Url url = virtualFileToUrl(chosenFile, project); + return url == null ? chosenFile.getUrl() : url.toDecodedForm(); } }); }