null pointer fix.
[jalview.git] / src / jalview / gui / SeqCanvas.java
index 789fb3f..c442465 100755 (executable)
@@ -219,8 +219,9 @@ public class SeqCanvas
   // Set this to false to force a full panel paint\r
   public void paintComponent(Graphics g)\r
   {\r
-    if (fastPaint  ||  getWidth() !=  g.getClipBounds().width\r
-                   ||  getHeight() != g.getClipBounds().height)\r
+    if (img!=null\r
+        && (fastPaint  ||  getWidth() !=  g.getClipBounds().width\r
+            ||  getHeight() != g.getClipBounds().height))\r
     {\r
       g.drawImage(img, 0, 0, this);\r
       fastPaint = false;\r