Skip to content

Commit

Permalink
Don't crash when saving an imported file without a valid XML file.
Browse files Browse the repository at this point in the history
  • Loading branch information
tinevez committed Jan 7, 2024
1 parent 878a1c4 commit 4e3672e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/main/java/org/mastodon/mamut/io/ProjectLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ static File originalOrBackupDatasetXml( final MamutProject project )
else
return copyBackupDatasetXmlToTmpFile( project );
}
catch ( final IOException e )
catch ( final IOException | NullPointerException e )
{
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
import org.mastodon.feature.FeatureSpecsService;
import org.mastodon.mamut.io.importer.ModelImporter;
import org.mastodon.mamut.io.project.MamutProject;
import org.mastodon.mamut.io.project.MamutProjectIO;
import org.mastodon.mamut.model.Link;
import org.mastodon.mamut.model.Model;
import org.mastodon.mamut.model.ModelGraph;
Expand Down Expand Up @@ -161,8 +162,7 @@ public MamutProject createProject() throws IOException
imageFile = makDummyImage( imageDataEl );
}
}

final MamutProject project = new MamutProject( null, imageFile );
final MamutProject project = MamutProjectIO.fromBdvFile( imageFile );

// Set project time and space units
final Element modelEl = root.getChild( MODEL_TAG );
Expand Down

0 comments on commit 4e3672e

Please sign in to comment.