From: kiramt Date: Mon, 8 May 2017 08:23:31 +0000 (+0100) Subject: JAL-2515 Id panel in applet updated for NPE on urlProvider X-Git-Tag: Release_2_10_2~3^2~99^2 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=5078a67d8357697791d2e71f9df95a46e762aa2e;p=jalview.git JAL-2515 Id panel in applet updated for NPE on urlProvider --- diff --git a/src/jalview/appletgui/IdPanel.java b/src/jalview/appletgui/IdPanel.java index e47c50a..4cc4a3a 100755 --- a/src/jalview/appletgui/IdPanel.java +++ b/src/jalview/appletgui/IdPanel.java @@ -35,6 +35,7 @@ import java.awt.event.InputEvent; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -225,6 +226,10 @@ public class IdPanel extends Panel implements MouseListener, String id = sq.getName(); // get the default url with the sequence details filled in + if (urlProvider == null) + { + return; + } String url = urlProvider.getPrimaryUrl(id); String target = urlProvider.getPrimaryTarget(id); try @@ -287,8 +292,15 @@ public class IdPanel extends Panel implements MouseListener, // build a new links menu based on the current links + any non-positional // features - List nlinks = urlProvider.getLinksForMenu(); - + List nlinks; + if (urlProvider != null) + { + nlinks = urlProvider.getLinksForMenu(); + } + else + { + nlinks = new ArrayList(); + } SequenceFeature sf[] = sq == null ? null : sq.getSequenceFeatures(); for (int sl = 0; sf != null && sl < sf.length; sl++) {