Merge branch 'bug/JAL-2784' into develop
authorJim Procter <jprocter@issues.jalview.org>
Fri, 17 Nov 2017 13:16:10 +0000 (13:16 +0000)
committerJim Procter <jprocter@issues.jalview.org>
Fri, 17 Nov 2017 13:16:10 +0000 (13:16 +0000)
src/jalview/gui/SeqCanvas.java

index cf1375e..433d2ec 100755 (executable)
@@ -780,8 +780,8 @@ public class SeqCanvas extends JComponent implements ViewportListenerI
      * white fill the region to be drawn (so incremental fast paint doesn't
      * scribble over an existing image)
      */
-    gg.setColor(Color.white);
-    gg.fillRect(0, ypos, (endx - startColumn + 1) * charWidth,
+    g.setColor(Color.white);
+    g.fillRect(0, ypos, (endx - startColumn + 1) * charWidth,
             wrappedRepeatHeightPx);
 
     drawPanel(g, startColumn, endx, 0, av.getAlignment().getHeight() - 1,
@@ -1659,7 +1659,7 @@ public class SeqCanvas extends JComponent implements ViewportListenerI
    */
   protected boolean drawMappedPositions(SearchResultsI results)
   {
-    if (results == null)
+    if ((results == null) || (gg == null)) // JAL-2784 check gg is not null
     {
       return false;
     }
@@ -2088,7 +2088,7 @@ public class SeqCanvas extends JComponent implements ViewportListenerI
    */
   protected boolean drawMappedPositionsWrapped(SearchResultsI results)
   {
-    if (results == null)
+    if ((results == null) || (gg == null)) // JAL-2784 check gg is not null
     {
       return false;
     }