fix null pointer exception when using blosum colourscheme
authorjprocter <Jim Procter>
Thu, 10 Sep 2009 08:54:49 +0000 (08:54 +0000)
committerjprocter <Jim Procter>
Thu, 10 Sep 2009 08:54:49 +0000 (08:54 +0000)
src/jalview/schemes/ResidueColourScheme.java

index cde457d..0577656 100755 (executable)
@@ -35,7 +35,7 @@ public class ResidueColourScheme implements ColourSchemeI
 
   boolean conservationColouring = false;
 
-  Color[] colors;
+  Color[] colors=null;
 
   int threshold = 0;
 
@@ -79,7 +79,7 @@ public class ResidueColourScheme implements ColourSchemeI
    */
   public Color findColour(char c)
   {
-    return colors[ResidueProperties.aaIndex[c]];
+    return colors==null ? Color.white : colors[ResidueProperties.aaIndex[c]];
   }
 
   public Color findColour(char c, int j)