From: Jim Procter Date: Mon, 1 Aug 2016 14:40:24 +0000 (+0100) Subject: Merge branch 'bug/JAL-2154projectMappings' into develop X-Git-Tag: Release_2_10_0~125 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=53e232c25d1956fdcc239b0db8d6b18cecc601a4;p=jalview.git Merge branch 'bug/JAL-2154projectMappings' into develop --- 53e232c25d1956fdcc239b0db8d6b18cecc601a4 diff --cc src/jalview/gui/Jalview2XML.java index f12d106,af820ca..68245b6 --- a/src/jalview/gui/Jalview2XML.java +++ b/src/jalview/gui/Jalview2XML.java @@@ -2276,21 -2377,16 +2377,24 @@@ public class Jalview2XM if (true) // !skipViewport(object)) { _af = loadFromObject(object, file, true, jprovider); - if (object.getJalviewModelSequence().getViewportCount() > 0) + if (_af != null + && object.getJalviewModelSequence().getViewportCount() > 0) { - af = _af; - if (af.viewport.isGatherViewsHere()) + if (af == null) { - gatherToThisFrame.put(af.viewport.getSequenceSetId(), af); + // store a reference to the first view + af = _af; + } + if (_af.viewport.isGatherViewsHere()) + { + // if this is a gathered view, keep its reference since + // after gathering views, only this frame will remain + af = _af; + gatherToThisFrame.put(_af.viewport.getSequenceSetId(), _af); } + // Save dataset to register mappings once all resolved + importedDatasets.put(af.viewport.getAlignment().getDataset(), + af.viewport.getAlignment().getDataset()); } } entryCount++;