diff --git a/platform/usageView/src/com/intellij/usages/ChunkExtractor.java b/platform/usageView/src/com/intellij/usages/ChunkExtractor.java index fa6f6d785052..929f0486299d 100644 --- a/platform/usageView/src/com/intellij/usages/ChunkExtractor.java +++ b/platform/usageView/src/com/intellij/usages/ChunkExtractor.java @@ -116,6 +116,7 @@ public class ChunkExtractor { Project project = file.getProject(); myDocument = PsiDocumentManager.getInstance(project).getDocument(file); + LOG.assertTrue(myDocument != null); final FileType fileType = file.getFileType(); SyntaxHighlighter highlighter = SyntaxHighlighterFactory.getSyntaxHighlighter(fileType, project, file.getVirtualFile()); highlighter = highlighter == null ? new PlainSyntaxHighlighter() : highlighter; diff --git a/platform/usageView/src/com/intellij/usages/UsageInfo2UsageAdapter.java b/platform/usageView/src/com/intellij/usages/UsageInfo2UsageAdapter.java index f2e2fe1ddf41..db5aa7917890 100644 --- a/platform/usageView/src/com/intellij/usages/UsageInfo2UsageAdapter.java +++ b/platform/usageView/src/com/intellij/usages/UsageInfo2UsageAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2015 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -520,13 +520,12 @@ public class UsageInfo2UsageAdapter implements UsageInModule, PsiFile file = getPsiFile(); if (file != null) { - ChunkExtractor extractor = ChunkExtractor.getExtractor(file); Segment segment = getFirstSegment(); if (segment != null) { Document document = PsiDocumentManager.getInstance(getProject()).getDocument(file); - if (document != null) { + ChunkExtractor extractor = ChunkExtractor.getExtractor(file); SmartList chunks = new SmartList(); extractor.createTextChunks( this,