From: jprocter Date: Fri, 22 Jul 2011 16:33:57 +0000 (+0100) Subject: fix NPE when annotation colourgradient is applied X-Git-Tag: Release_2_7~126 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=4789b0c6467eee2928113c97fe03e887ea4032d4;p=jalview.git fix NPE when annotation colourgradient is applied --- diff --git a/src/jalview/appletgui/TreeCanvas.java b/src/jalview/appletgui/TreeCanvas.java index a9a4bfe..1cab8d8 100755 --- a/src/jalview/appletgui/TreeCanvas.java +++ b/src/jalview/appletgui/TreeCanvas.java @@ -623,9 +623,12 @@ public class TreeCanvas extends Panel implements MouseListener, .getWidth(), ColourSchemeProperty.getColourName(av .getGlobalColourScheme())); } - - cs.setThreshold(av.getGlobalColourScheme().getThreshold(), - av.getIgnoreGapsConsensus()); + // cs is null if shading is an annotationColourGradient + if (cs!=null) + { + cs.setThreshold(av.getGlobalColourScheme().getThreshold(), + av.getIgnoreGapsConsensus()); + } } SequenceGroup sg = new SequenceGroup(sequences, "", cs, true, true, diff --git a/src/jalview/gui/TreeCanvas.java b/src/jalview/gui/TreeCanvas.java index ea78d0f..17830fe 100755 --- a/src/jalview/gui/TreeCanvas.java +++ b/src/jalview/gui/TreeCanvas.java @@ -905,9 +905,12 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable, .getWidth(), ColourSchemeProperty.getColourName(av .getGlobalColourScheme())); } - - cs.setThreshold(av.getGlobalColourScheme().getThreshold(), - av.getIgnoreGapsConsensus()); + // cs is null if shading is an annotationColourGradient + if (cs!=null) + { + cs.setThreshold(av.getGlobalColourScheme().getThreshold(), + av.getIgnoreGapsConsensus()); + } } SequenceGroup sg = new SequenceGroup(sequences, null, cs, true, true,