Add diagnostic info
authorAlexander Zolotov <alexander.zolotov@jetbrains.com>
Thu, 3 Sep 2015 11:38:34 +0000 (14:38 +0300)
committerAlexander Zolotov <alexander.zolotov@jetbrains.com>
Fri, 4 Sep 2015 07:40:25 +0000 (10:40 +0300)
xml/impl/src/com/intellij/codeInsight/template/emmet/ZenCodingTemplate.java

index 9a446bf77610ce46e5eddb030ab0cdec544b14a2..72a9689736da1421fce8130b6fdf1fc87b634d69 100644 (file)
@@ -106,7 +106,11 @@ public class ZenCodingTemplate extends CustomLiveTemplateBase {
   @Override
   public void expand(@NotNull String key, @NotNull CustomTemplateCallback callback) {
     ZenCodingGenerator defaultGenerator = findApplicableDefaultGenerator(callback.getContext(), false);
-    assert defaultGenerator != null;
+    if (defaultGenerator == null) {
+      LOG.error("Cannot find defaultGenerator for key `" + key +"` at " + callback.getEditor().getCaretModel().getOffset() + " offset", 
+                AttachmentFactory.createAttachment(callback.getEditor().getDocument()));
+      return;
+    }
     try {
       expand(key, callback, defaultGenerator, Collections.<ZenCodingFilter>emptyList(), true, Registry.intValue("emmet.segments.limit"));
     }