From 380ae32ce4867926c44f0bf35fdce51ee4bf5d65 Mon Sep 17 00:00:00 2001 From: sweinreuter Date: Thu, 14 Apr 2011 12:18:25 +0200 Subject: [PATCH] XmlFile.getVirtualFile() may be null here --- .../lang/xpath/xslt/impl/XsltIncludeIndex.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/impl/XsltIncludeIndex.java b/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/impl/XsltIncludeIndex.java index a1720eca436d..d503c7d38428 100644 --- a/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/impl/XsltIncludeIndex.java +++ b/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/impl/XsltIncludeIndex.java @@ -54,10 +54,15 @@ public class XsltIncludeIndex { } public static boolean processBackwardDependencies(@NotNull XmlFile file, Processor processor) { - Project project = file.getProject(); + final VirtualFile virtualFile = file.getVirtualFile(); + if (virtualFile == null) { + return true; + } + final Project project = file.getProject(); final PsiManager psiManager = PsiManager.getInstance(project); - VirtualFile[] files = FileIncludeManager.getManager(project).getIncludingFiles(file.getVirtualFile(), true); - PsiFile[] psiFiles = ContainerUtil.map2Array(files, PsiFile.class, new NullableFunction() { + + final VirtualFile[] files = FileIncludeManager.getManager(project).getIncludingFiles(virtualFile, true); + final PsiFile[] psiFiles = ContainerUtil.map2Array(files, PsiFile.class, new NullableFunction() { public PsiFile fun(VirtualFile file) { return psiManager.findFile(file); }