From: Jim Procter Date: Thu, 26 Oct 2017 16:18:57 +0000 (+0100) Subject: JAL-2488 patch causes of NPE during testStoreAndRecoverExpandedviews Jalview2xml... X-Git-Tag: Release_2_10_3b1~57 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=ea2cf1fb34a7630388e87c058d994d2a4017f9e3;p=jalview.git JAL-2488 patch causes of NPE during testStoreAndRecoverExpandedviews Jalview2xml tests. --- diff --git a/src/jalview/gui/TreePanel.java b/src/jalview/gui/TreePanel.java index 82f3565..2727db1 100755 --- a/src/jalview/gui/TreePanel.java +++ b/src/jalview/gui/TreePanel.java @@ -155,7 +155,10 @@ public class TreePanel extends GTreePanel @Override public void internalFrameClosed(InternalFrameEvent evt) { - av.removePropertyChangeListener(listener); + if (av != null) + { + av.removePropertyChangeListener(listener); + } } }); diff --git a/src/jalview/viewmodel/AlignmentViewport.java b/src/jalview/viewmodel/AlignmentViewport.java index fdad0ce..a0cbff4 100644 --- a/src/jalview/viewmodel/AlignmentViewport.java +++ b/src/jalview/viewmodel/AlignmentViewport.java @@ -1338,7 +1338,10 @@ public abstract class AlignmentViewport public void removePropertyChangeListener( java.beans.PropertyChangeListener listener) { - changeSupport.removePropertyChangeListener(listener); + if (changeSupport != null) + { + changeSupport.removePropertyChangeListener(listener); + } } /**