From dda77016b864ec689d98677ca6848e1e92420e44 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Tue, 5 Sep 2017 15:40:41 +0100 Subject: [PATCH] JAL-2665 check for null selection group image --- src/jalview/gui/SeqCanvas.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/jalview/gui/SeqCanvas.java b/src/jalview/gui/SeqCanvas.java index 3d8b8aa..d434ba8 100755 --- a/src/jalview/gui/SeqCanvas.java +++ b/src/jalview/gui/SeqCanvas.java @@ -437,12 +437,16 @@ public class SeqCanvas extends JComponent implements ViewportListenerI public void drawPanelForPrinting(Graphics g1, int startRes, int endRes, int startSeq, int endSeq) { + drawPanel(g1, startRes, endRes, startSeq, endSeq, 0); + BufferedImage selectImage = drawSelectionGroup(startRes, endRes, startSeq, endSeq); - drawPanel(g1, startRes, endRes, startSeq, endSeq, 0); - ((Graphics2D) g1).setComposite( - AlphaComposite.getInstance(AlphaComposite.SRC_OVER)); - g1.drawImage(selectImage, 0, 0, this); + if (selectImage != null) + { + ((Graphics2D) g1).setComposite(AlphaComposite + .getInstance(AlphaComposite.SRC_OVER)); + g1.drawImage(selectImage, 0, 0, this); + } } /** -- 1.7.10.2