From 63dc4eb11b8a7129326134f4d9a041823372778c Mon Sep 17 00:00:00 2001 From: gmungoc Date: Fri, 30 Nov 2018 10:15:11 +0000 Subject: [PATCH] JAL-3166 catch NPE if all sequences are hidden --- src/jalview/gui/IdPanel.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/jalview/gui/IdPanel.java b/src/jalview/gui/IdPanel.java index a183144..fb37445 100755 --- a/src/jalview/gui/IdPanel.java +++ b/src/jalview/gui/IdPanel.java @@ -330,8 +330,11 @@ public class IdPanel extends JPanel * build a new links menu based on the current links * and any non-positional features */ + List features = null; + if (sq != null) + { List nlinks = Preferences.sequenceUrlLinks.getLinksForMenu(); - List features = sq.getFeatures().getNonPositionalFeatures(); + features = sq.getFeatures().getNonPositionalFeatures(); for (SequenceFeature sf : features) { if (sf.links != null) @@ -342,6 +345,7 @@ public class IdPanel extends JPanel } } } + } PopupMenu pop = new PopupMenu(alignPanel, sq, features, Preferences.getGroupURLLinks()); -- 1.7.10.2