diff --git a/plugins/IntelliLang/java-support/org/intellij/plugins/intelliLang/inject/java/JavaLanguageInjectionSupport.java b/plugins/IntelliLang/java-support/org/intellij/plugins/intelliLang/inject/java/JavaLanguageInjectionSupport.java index 5fc66d549846..f0f62d5a57c3 100644 --- a/plugins/IntelliLang/java-support/org/intellij/plugins/intelliLang/inject/java/JavaLanguageInjectionSupport.java +++ b/plugins/IntelliLang/java-support/org/intellij/plugins/intelliLang/inject/java/JavaLanguageInjectionSupport.java @@ -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 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); }