Skip to content

Commit

Permalink
fix exception if easter eggs are used
Browse files Browse the repository at this point in the history
  • Loading branch information
StephanPreibisch committed Nov 12, 2024
1 parent ec21fff commit 63e7ca9
Showing 1 changed file with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,18 @@ public boolean queryXML(

// try parsing if it ends with XML
// also initializes messages
tryParsing( defaultXMLURI.trim().length() == 0 ? URI.create( "" ) : URITools.toURI( defaultXMLURI ), false );
// could be an 'easter egg', fixed by not assigned them as default below
URI uritmp;
try
{
uritmp = defaultXMLURI.trim().length() == 0 ? URI.create( "" ) : URITools.toURI( defaultXMLURI );
}
catch ( Exception e )
{
uritmp = URI.create( defaultXMLURI = "" );
}

tryParsing( uritmp, false );

if ( additionalTitle != null && additionalTitle.length() > 0 )
gd = new GenericDialogPlus( "Select dataset for " + additionalTitle );
Expand Down Expand Up @@ -349,7 +360,11 @@ public boolean queryXML(
if ( gd.wasCanceled() )
return false;

String xmlURI = defaultXMLURI = gd.getNextString();
String xmlURI = gd.getNextString();

// only remember XML's > easter eggs create issues down the line as they are a relative URI
if ( xmlURI.endsWith( ".xml" ) )
defaultXMLURI = xmlURI;

// try to parse the file anyways
boolean success;
Expand Down

0 comments on commit 63e7ca9

Please sign in to comment.