catch null pointer exception when no colourscheme is active
authorjprocter <Jim Procter>
Fri, 19 Dec 2008 15:36:30 +0000 (15:36 +0000)
committerjprocter <Jim Procter>
Fri, 19 Dec 2008 15:36:30 +0000 (15:36 +0000)
src/jalview/gui/UserDefinedColours.java

index ca1ebf4..83f9d0c 100755 (executable)
@@ -373,12 +373,14 @@ public class UserDefinedColours extends GUserDefinedColours implements
       caseSensitiveButtons.addElement(button);
 
       col = Color.white;
-
-      try
-      {
-        col = oldColourScheme.findColour(aa.charAt(0), -1);
-      } catch (Exception ex)
+      if (oldColourScheme!=null)
       {
+        try
+        {
+          col = oldColourScheme.findColour(aa.charAt(0), -1);
+        } catch (Exception ex)
+        {
+        }
       }
     }