NPE in gutterClosed()
authorKonstantin Bulenkov <kb@jetbrains.com>
Fri, 5 Mar 2010 16:53:21 +0000 (19:53 +0300)
committerKonstantin Bulenkov <kb@jetbrains.com>
Fri, 5 Mar 2010 16:53:21 +0000 (19:53 +0300)
platform/vcs-impl/src/com/intellij/openapi/vcs/actions/AnnotationFieldGutter.java

index 2ac37f45dd8cbf8a0d3b0671509ef1392250b063..c54ca5b5f338e21a8a3f7cc9cfea54e7b8b90f3e 100644 (file)
@@ -28,6 +28,7 @@ import com.intellij.xml.util.XmlStringUtil;
 import org.jetbrains.annotations.Nullable;
 
 import java.awt.*;
+import java.util.Collection;
 import java.util.List;
 import java.util.Map;
 
@@ -104,8 +105,11 @@ class AnnotationFieldGutter implements ActiveAnnotationGutter {
 
   public void gutterClosed() {
     myAnnotation.removeListener(myListener);
-    myAnnotation.dispose();
-    myEditor.getUserData(AnnotateToggleAction.KEY_IN_EDITOR).remove(this);
+    myAnnotation.dispose();    
+    final Collection<ActiveAnnotationGutter> gutters = myEditor.getUserData(AnnotateToggleAction.KEY_IN_EDITOR);
+    if (gutters != null) {
+      gutters.remove(this);
+    }
   }
 
   @Nullable