diff --git a/platform/lang-impl/src/com/intellij/usageView/UsageViewUtil.java b/platform/lang-impl/src/com/intellij/usageView/UsageViewUtil.java index dc33a1af367b..d1956b928f34 100644 --- a/platform/lang-impl/src/com/intellij/usageView/UsageViewUtil.java +++ b/platform/lang-impl/src/com/intellij/usageView/UsageViewUtil.java @@ -125,9 +125,11 @@ public class UsageViewUtil { TextRange rangeInElement = usage.getRangeInElement(); assert rangeInElement != null : usage; TextRange range = rangeInElement.shiftRight(injectionOffsetInMasterFile); + PsiFile containingFile = context.getContainingFile(); + if (containingFile == null) continue; //move package to another package set.remove( NonCodeUsageInfo.create( - context.getContainingFile(), + containingFile, range.getStartOffset(), range.getEndOffset(), ((MoveRenameUsageInfo)usage).getReferencedElement(),