JAL-1896 fixed NPE for RNA Helice without equivalent annotation
authortcofoegbu <tcnofoegbu@dundee.ac.uk>
Tue, 29 Sep 2015 10:46:54 +0000 (11:46 +0100)
committertcofoegbu <tcnofoegbu@dundee.ac.uk>
Tue, 29 Sep 2015 10:46:54 +0000 (11:46 +0100)
src/jalview/appletgui/CutAndPasteTransfer.java
src/jalview/gui/CutAndPasteTransfer.java
src/jalview/io/FileLoader.java
src/jalview/io/JSONFile.java

index 1ee8393..70a7319 100644 (file)
@@ -268,7 +268,10 @@ public class CutAndPasteTransfer extends Panel implements ActionListener,
           af.getAlignViewport().setShowSequenceFeatures(showSeqFeatures);
           ColourSchemeI cs = ColourSchemeMapper.getJalviewColourScheme(
                   colourSchemeName, al);
-          af.changeColour(cs);
+          if (cs != null)
+          {
+            af.changeColour(cs);
+          }
         }
         else
         {
index acc71f3..4541fc2 100644 (file)
@@ -273,7 +273,10 @@ public class CutAndPasteTransfer extends GCutAndPasteTransfer
           af.getViewport().setFeaturesDisplayed(fd);
           ColourSchemeI cs = ColourSchemeMapper.getJalviewColourScheme(
                   colourSchemeName, al);
-          af.changeColour(cs);
+          if (cs != null)
+          {
+            af.changeColour(cs);
+          }
         }
         else
         {
index 9931f32..11c40c3 100755 (executable)
@@ -388,7 +388,10 @@ public class FileLoader implements Runnable
               alignFrame.getViewport().setFeaturesDisplayed(fd);
               ColourSchemeI cs = ColourSchemeMapper.getJalviewColourScheme(
                       colourSchemeName, al);
-              alignFrame.changeColour(cs);
+              if (cs != null)
+              {
+                alignFrame.changeColour(cs);
+              }
             }
             else
             {
index 8725556..3ac4aa7 100644 (file)
@@ -209,6 +209,13 @@ public class JSONFile extends AlignFile implements ComplexAlignFile
         jsonAlignmentPojo
                 .setAlignAnnotation(annotationToJsonPojo(annotations));
       }
+      else
+      {
+        if (globalColourScheme.equalsIgnoreCase("RNA Helices"))
+        {
+          jsonAlignmentPojo.setGlobalColorScheme("None");
+        }
+      }
 
       if (exportSettings.isExportFeatures())
       {