From 61bf2d7e74ca618f49acf1ae41a389c387e072ce Mon Sep 17 00:00:00 2001 From: Anna Kozlova Date: Wed, 12 Jun 2019 14:36:03 +0200 Subject: [PATCH] iterate: don't load template settings (IDEA-216055) GitOrigin-RevId: 07db195a19205f7ee0fce3757df80ea1d35a1f50 --- .../daemon/impl/quickfix/IterateOverIterableIntention.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/IterateOverIterableIntention.java b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/IterateOverIterableIntention.java index 11c66b4280ca..9806eb67fc6b 100644 --- a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/IterateOverIterableIntention.java +++ b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/IterateOverIterableIntention.java @@ -39,7 +39,7 @@ public class IterateOverIterableIntention implements IntentionAction { @Override public boolean isAvailable(@NotNull Project project, Editor editor, PsiFile file) { - final TemplateImpl template = getTemplate(); + final TemplateImpl template = file instanceof PsiJavaFile ? getTemplate() : null; if (template != null) { int offset = editor.getCaretModel().getOffset(); int startOffset = offset;