Format changes
[jalview.git] / src / jalview / schemes / PIDColourScheme.java
index e09745a..9bd092e 100755 (executable)
@@ -44,13 +44,19 @@ public class PIDColourScheme
       s = String.valueOf(res -= ('a' - 'A'));\r
     }\r
 \r
+    if (consensus == null\r
+        || j >= consensus.length\r
+        || consensus[j]==null)\r
+    {\r
+      return Color.white;\r
+    }\r
 \r
     if ( (threshold != 0) && !aboveThreshold(s, j))\r
     {\r
       return Color.white;\r
     }\r
 \r
-    currentColour = Color.white;\r
+    Color currentColour = Color.white;\r
 \r
     double sc = 0;\r
 \r
@@ -77,7 +83,7 @@ public class PIDColourScheme
       }\r
 \r
     if(conservationColouring)\r
-         applyConservation(j);\r
+      currentColour = applyConservation(currentColour, j);\r
 \r
     return currentColour;\r
   }\r