in progress
authorcmzmasek@gmail.com <cmzmasek@gmail.com@ca865154-3058-d1c3-3e42-d8f55a55bdbd>
Wed, 20 Aug 2014 02:58:41 +0000 (02:58 +0000)
committercmzmasek@gmail.com <cmzmasek@gmail.com@ca865154-3058-d1c3-3e42-d8f55a55bdbd>
Wed, 20 Aug 2014 02:58:41 +0000 (02:58 +0000)
forester/java/src/org/forester/archaeopteryx/TreePanel.java

index 341a8cb..e3585e6 100644 (file)
@@ -4871,9 +4871,11 @@ public final class TreePanel extends JPanel implements ActionListener, MouseWhee
 
     final private int calcLengthOfLongestText() {
         final StringBuilder sb = new StringBuilder();
-        nodeDataAsSB( _ext_node_with_longest_txt_info, sb );
-        if ( _ext_node_with_longest_txt_info.getNodeData().isHasTaxonomy() ) {
-            nodeTaxonomyDataAsSB( _ext_node_with_longest_txt_info.getNodeData().getTaxonomy(), sb );
+        if ( _ext_node_with_longest_txt_info != null ) {
+            nodeDataAsSB( _ext_node_with_longest_txt_info, sb );
+            if ( _ext_node_with_longest_txt_info.getNodeData().isHasTaxonomy() ) {
+                nodeTaxonomyDataAsSB( _ext_node_with_longest_txt_info.getNodeData().getTaxonomy(), sb );
+            }
         }
         return getFontMetricsForLargeDefaultFont().stringWidth( sb.toString() );
     }