- if ( phys_url != null ) {
- try {
- phys = AptxUtil.readPhylogeniesFromUrl( phys_url,
- getConfiguration().isValidatePhyloXmlAgainstSchema(),
- getConfiguration().isReplaceUnderscoresInNhParsing(),
- getConfiguration().isInternalNumberAreConfidenceForNhParsing(),
- getConfiguration().getTaxonomyExtraction() );
- }
- catch ( final Exception e ) {
- ForesterUtil.printErrorMessage( NAME, e.toString() );
- e.printStackTrace();
- JOptionPane.showMessageDialog( this,
- NAME + ": Failed to read phylogenies: " + "\nException: " + e,
- "Failed to read phylogenies",
- JOptionPane.ERROR_MESSAGE );
- }
+ Phylogeny[] phys = null;
+ try {
+ phys = AptxUtil.readPhylogeniesFromUrl( phys_url,
+ getConfiguration().isValidatePhyloXmlAgainstSchema(),
+ getConfiguration().isReplaceUnderscoresInNhParsing(),
+ getConfiguration().isInternalNumberAreConfidenceForNhParsing(),
+ getConfiguration().getTaxonomyExtraction(),
+ getConfiguration().isMidpointReroot() );
+ }
+ catch ( final Exception e ) {
+ ForesterUtil.printErrorMessage( NAME, e.toString() );
+ e.printStackTrace();
+ JOptionPane.showMessageDialog( this,
+ NAME + ": Failed to read phylogenies: " + "\nException: " + e,
+ "Failed to read phylogenies",
+ JOptionPane.ERROR_MESSAGE );
+ }
+ if ( phys == null ) {
+ ForesterUtil.printErrorMessage( NAME, "phylogenies from [" + phys_url + "] are null" );
+ JOptionPane.showMessageDialog( this,
+ NAME + ": phylogenies from [" + phys_url + "] are null",
+ "Failed to read phylogenies",
+ JOptionPane.ERROR_MESSAGE );
+ return;