JAL-3166 catch NPE if all sequences are hidden bug/JAL-3166npeAllRowsHidden
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Fri, 30 Nov 2018 10:15:11 +0000 (10:15 +0000)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Fri, 30 Nov 2018 10:15:11 +0000 (10:15 +0000)
src/jalview/gui/IdPanel.java

index a183144..fb37445 100755 (executable)
@@ -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<SequenceFeature> features = null;
+    if (sq != null)
+    {
     List<String> nlinks = Preferences.sequenceUrlLinks.getLinksForMenu();
-    List<SequenceFeature> 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());