clean up
authorEugene Kudelevsky <Eugene.Kudelevsky@jetbrains.com>
Mon, 1 Mar 2010 13:38:32 +0000 (16:38 +0300)
committerEugene Kudelevsky <Eugene.Kudelevsky@jetbrains.com>
Mon, 1 Mar 2010 13:38:32 +0000 (16:38 +0300)
platform/lang-impl/src/com/intellij/codeInsight/template/CustomTemplateCallback.java

index bc7f6008b0a3e62bbf6452bda27b57de5a67eb0e..d1eab1c720bbfe5ec1df51fb561efc29a0289729 100644 (file)
@@ -200,7 +200,9 @@ public class CustomTemplateCallback {
   public void finish() {
     myEditor.getScrollingModel().scrollToCaret(ScrollType.MAKE_VISIBLE);
     final CodeStyleManager style = CodeStyleManager.getInstance(myProject);
-    style.reformatText(myFile, myGlobalMarker.getStartOffset(), myGlobalMarker.getEndOffset());
+    if (myGlobalMarker != null) {
+      style.reformatText(myFile, myGlobalMarker.getStartOffset(), myGlobalMarker.getEndOffset());
+    }
     gotoEndOffset();
   }