From: tcofoegbu Date: Tue, 29 Sep 2015 10:46:54 +0000 (+0100) Subject: JAL-1896 fixed NPE for RNA Helice without equivalent annotation X-Git-Tag: Release_2_10_0~382 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=0fd1986d18c3093cc5386697ed49301599b74379;p=jalview.git JAL-1896 fixed NPE for RNA Helice without equivalent annotation --- diff --git a/src/jalview/appletgui/CutAndPasteTransfer.java b/src/jalview/appletgui/CutAndPasteTransfer.java index 1ee8393..70a7319 100644 --- a/src/jalview/appletgui/CutAndPasteTransfer.java +++ b/src/jalview/appletgui/CutAndPasteTransfer.java @@ -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 { diff --git a/src/jalview/gui/CutAndPasteTransfer.java b/src/jalview/gui/CutAndPasteTransfer.java index acc71f3..4541fc2 100644 --- a/src/jalview/gui/CutAndPasteTransfer.java +++ b/src/jalview/gui/CutAndPasteTransfer.java @@ -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 { diff --git a/src/jalview/io/FileLoader.java b/src/jalview/io/FileLoader.java index 9931f32..11c40c3 100755 --- a/src/jalview/io/FileLoader.java +++ b/src/jalview/io/FileLoader.java @@ -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 { diff --git a/src/jalview/io/JSONFile.java b/src/jalview/io/JSONFile.java index 8725556..3ac4aa7 100644 --- a/src/jalview/io/JSONFile.java +++ b/src/jalview/io/JSONFile.java @@ -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()) {