JAL-2853 fix small bug where the font of a not yet existing panel is set
authorkjvdheide <kjvanderheide@dundee.ac.uk>
Mon, 27 Nov 2017 16:47:05 +0000 (16:47 +0000)
committerkjvdheide <kjvanderheide@dundee.ac.uk>
Mon, 27 Nov 2017 16:47:05 +0000 (16:47 +0000)
forester/java/src/org/forester/archaeopteryx/TreePanel.java

index 6321315..65faa81 100644 (file)
@@ -4720,7 +4720,7 @@ public final class TreePanel extends JPanel implements ActionListener, MouseWhee
             }
             boolean use_vis = false;
             final Graphics2D g = ( Graphics2D ) getGraphics();
-            if ( getControlPanel().isUseVisualStyles() ) {
+            if ( g != null && getControlPanel().isUseVisualStyles() ) {
                 use_vis = setFont( g, node, false );
             }
             if ( !use_vis ) {