From ea2cf1fb34a7630388e87c058d994d2a4017f9e3 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Thu, 26 Oct 2017 17:18:57 +0100 Subject: [PATCH] JAL-2488 patch causes of NPE during testStoreAndRecoverExpandedviews Jalview2xml tests. --- src/jalview/gui/TreePanel.java | 5 ++++- src/jalview/viewmodel/AlignmentViewport.java | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) 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); + } } /** -- 1.7.10.2