From: amwaterhouse Date: Tue, 20 Sep 2005 13:15:31 +0000 (+0000) Subject: Null pointer if user presses shift before anything else X-Git-Tag: Release_2_06~41 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=5ad6d650b6726eb880d8342d19711e626f6ae2f0;p=jalview.git Null pointer if user presses shift before anything else --- diff --git a/src/jalview/gui/UserDefinedColours.java b/src/jalview/gui/UserDefinedColours.java index 79df106..ec4ad55 100755 --- a/src/jalview/gui/UserDefinedColours.java +++ b/src/jalview/gui/UserDefinedColours.java @@ -139,8 +139,12 @@ public class UserDefinedColours extends GUserDefinedColours if(e.isShiftDown()) { - JButton start = (JButton)selectedButtons.elementAt(selectedButtons.size()-1); - JButton end = (JButton) e.getSource(); + JButton start, end = (JButton) e.getSource(); + if(selectedButtons.size()>1) + start = (JButton)selectedButtons.elementAt(selectedButtons.size()-1); + else + start = (JButton) e.getSource(); + int startIndex=0, endIndex=0; for(int b=0; b