JAL-2488 patch causes of NPE during testStoreAndRecoverExpandedviews Jalview2xml...
authorJim Procter <jprocter@issues.jalview.org>
Thu, 26 Oct 2017 16:18:57 +0000 (17:18 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Thu, 26 Oct 2017 16:18:57 +0000 (17:18 +0100)
src/jalview/gui/TreePanel.java
src/jalview/viewmodel/AlignmentViewport.java

index 82f3565..2727db1 100755 (executable)
@@ -155,7 +155,10 @@ public class TreePanel extends GTreePanel
       @Override
       public void internalFrameClosed(InternalFrameEvent evt)
       {
-        av.removePropertyChangeListener(listener);
+        if (av != null)
+        {
+          av.removePropertyChangeListener(listener);
+        }
       }
     });
 
index fdad0ce..a0cbff4 100644 (file)
@@ -1338,7 +1338,10 @@ public abstract class AlignmentViewport
   public void removePropertyChangeListener(
           java.beans.PropertyChangeListener listener)
   {
-    changeSupport.removePropertyChangeListener(listener);
+    if (changeSupport != null)
+    {
+      changeSupport.removePropertyChangeListener(listener);
+    }
   }
 
   /**