Naive fix for EA-53569
authorVassiliy <vassiliy.kudryashov@jetbrains.com>
Wed, 23 Apr 2014 19:02:57 +0000 (23:02 +0400)
committerVassiliy <vassiliy.kudryashov@jetbrains.com>
Wed, 23 Apr 2014 19:03:27 +0000 (23:03 +0400)
platform/platform-impl/src/com/intellij/notification/impl/NotificationsManagerImpl.java

index 3733d3faa6462d2ac87243c3fb1520ecb3ef4173..1ef2f4c7cbb7284da557d9817b239a740c0db41a 100644 (file)
@@ -276,7 +276,9 @@ public class NotificationsManagerImpl extends NotificationsManager {
 
     final JPanel content = new NonOpaquePanel(new BorderLayout((int)(label.getIconTextGap() * 1.5), (int)(label.getIconTextGap() * 1.5)));
 
-    text.setCaretPosition(0);
+    if (text.getCaret() != null) {
+      text.setCaretPosition(0);
+    }
     JScrollPane pane = ScrollPaneFactory.createScrollPane(text,
                                                           ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
                                                           ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);