From: Jim Procter Date: Thu, 25 Jun 2015 10:13:09 +0000 (+0100) Subject: JAL-1691 avoid NPE when original split frame has been closed before the alignment... X-Git-Tag: Release_2_10_0~564^2~1 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=59c9459d9b84f5e980da09599f2f0067a639fa8b;p=jalview.git JAL-1691 avoid NPE when original split frame has been closed before the alignment completes. See JAL-1792 for enhancement on this code. --- 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)