[java] NPE (EA-92450)

This commit is contained in:
Roman Shevchenko
2017-01-09 19:58:29 +01:00
parent 3d1b114a04
commit 138314f812
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2016 JetBrains s.r.o.
* Copyright 2000-2017 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.
@@ -102,7 +102,8 @@ public class JavaLanguageInjectionSupport extends AbstractLanguageInjectionSuppo
@Nullable
@Override
public BaseInjection findCommentInjection(@NotNull PsiElement host, @Nullable Ref<PsiElement> commentRef) {
boolean compiled = host.getContainingFile().getOriginalFile() instanceof PsiCompiledFile;
PsiFile containingFile = host.getContainingFile();
boolean compiled = containingFile != null && containingFile.getOriginalFile() instanceof PsiCompiledFile;
return compiled ? null : super.findCommentInjection(host, commentRef);
}