Check on null consensus
[jalview.git] / src / jalview / schemes / PIDColourScheme.java
index e09745a..7f4bebe 100755 (executable)
@@ -44,6 +44,11 @@ public class PIDColourScheme
       s = String.valueOf(res -= ('a' - 'A'));\r
     }\r
 \r
+    if (consensus == null ||\r
+        j >= consensus.length)\r
+    {\r
+      return Color.white;\r
+    }\r
 \r
     if ( (threshold != 0) && !aboveThreshold(s, j))\r
     {\r