From 59c9459d9b84f5e980da09599f2f0067a639fa8b Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Thu, 25 Jun 2015 11:13:09 +0100 Subject: [PATCH] JAL-1691 avoid NPE when original split frame has been closed before the alignment completes. See JAL-1792 for enhancement on this code. --- src/jalview/ws/jws2/MsaWSThread.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/jalview/ws/jws2/MsaWSThread.java b/src/jalview/ws/jws2/MsaWSThread.java index d0d0a6e..d2c1b38 100644 --- a/src/jalview/ws/jws2/MsaWSThread.java +++ b/src/jalview/ws/jws2/MsaWSThread.java @@ -959,6 +959,7 @@ class MsaWSThread extends AWS2Thread implements WSClientI } else { + // TODO 2.9.x feature System.out.println("MERGE WITH OLD FRAME"); // TODO: modify alignment in original frame, replacing old for new // alignment using the commands.EditCommand model to ensure the update can @@ -987,17 +988,22 @@ class MsaWSThread extends AWS2Thread implements WSClientI addSortByMenuItems(af, alorders); } + // TODO: refactor retrieve and show as new splitFrame as Desktop method + /* * If alignment was requested from one half of a SplitFrame, show in a * SplitFrame with the other pane similarly aligned. */ AlignFrame requestedBy = getRequestingAlignFrame(); - if (requestedBy != null && requestedBy.getSplitViewContainer() != null) + if (requestedBy != null && requestedBy.getSplitViewContainer() != null + && requestedBy.getSplitViewContainer().getComplement(requestedBy)!=null) { AlignmentI complement = requestedBy.getSplitViewContainer() .getComplement(requestedBy); String complementTitle = requestedBy.getSplitViewContainer() .getComplementTitle(requestedBy); + // becomes null if the alignment window was closed before the alignment + // job finished. AlignmentI copyComplement = new Alignment(complement); copyComplement.alignAs(al); if (copyComplement.getHeight() > 0) -- 1.7.10.2