From: gmungoc Date: Wed, 26 Aug 2015 14:30:50 +0000 (+0100) Subject: JAL-1596 check for null pointer (thread running after viewer closed) X-Git-Tag: Jalview_2_9~10^2~19 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=ab28bc91ab1cb7c4ef677dfebd66cd6beadf2f18;p=jalview.git JAL-1596 check for null pointer (thread running after viewer closed) --- diff --git a/src/jalview/ext/rbvi/chimera/JalviewChimeraBinding.java b/src/jalview/ext/rbvi/chimera/JalviewChimeraBinding.java index b648bea..368918b 100644 --- a/src/jalview/ext/rbvi/chimera/JalviewChimeraBinding.java +++ b/src/jalview/ext/rbvi/chimera/JalviewChimeraBinding.java @@ -20,18 +20,6 @@ */ package jalview.ext.rbvi.chimera; -import java.awt.Color; -import java.net.BindException; -import java.util.ArrayList; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; - -import ext.edu.ucsf.rbvi.strucviz2.ChimeraManager; -import ext.edu.ucsf.rbvi.strucviz2.ChimeraModel; -import ext.edu.ucsf.rbvi.strucviz2.StructureManager; -import ext.edu.ucsf.rbvi.strucviz2.StructureManager.ModelType; - import jalview.api.AlignmentViewPanel; import jalview.api.FeatureRenderer; import jalview.api.SequenceRenderer; @@ -49,6 +37,18 @@ import jalview.structure.StructureSelectionManager; import jalview.structures.models.AAStructureBindingModel; import jalview.util.MessageManager; +import java.awt.Color; +import java.net.BindException; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import ext.edu.ucsf.rbvi.strucviz2.ChimeraManager; +import ext.edu.ucsf.rbvi.strucviz2.ChimeraModel; +import ext.edu.ucsf.rbvi.strucviz2.StructureManager; +import ext.edu.ucsf.rbvi.strucviz2.StructureManager.ModelType; + public abstract class JalviewChimeraBinding extends AAStructureBindingModel { // Chimera clause to exclude alternate locations in atom selection @@ -608,6 +608,11 @@ public abstract class JalviewChimeraBinding extends AAStructureBindingModel */ public void sendChimeraCommand(final String command, boolean logResponse) { + if (viewer == null) + { + // ? thread running after viewer shut down + return; + } viewerCommandHistory(false); if (lastCommand == null || !lastCommand.equals(command)) {