fix null pointer exception when using blosum colourscheme
[jalview.git] / 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)