work for rrm project (ComPhy 2012 Moscow)
[jalview.git] / forester / java / src / org / forester / io / writers / PhyloXmlNodeWriter.java
index 5860cac..67d38d4 100644 (file)
@@ -39,7 +39,7 @@ public class PhyloXmlNodeWriter {
     public static void toPhyloXml( final Writer w, final PhylogenyNode node, final int level, final String indentation )
             throws IOException {
         String ind = "";
-        if ( indentation.length() > 0 ) {
+        if ( ( indentation != null ) && ( indentation.length() > 0 ) ) {
             ind = indentation + PhylogenyWriter.PHYLO_XML_INTENDATION_BASE;
         }
         if ( !ForesterUtil.isEmpty( node.getName() ) ) {