From a3e9a7b9ecf7faa16e6e2aedd8ad710a12adc65a Mon Sep 17 00:00:00 2001 From: Jean-Yves Tinevez Date: Thu, 25 Jul 2024 17:19:02 +0200 Subject: [PATCH] Don't crash when saving with an image without an associated on-disk location Fix #303 Reported by @jiyuuchc --- src/main/java/fiji/plugin/trackmate/util/TMUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/fiji/plugin/trackmate/util/TMUtils.java b/src/main/java/fiji/plugin/trackmate/util/TMUtils.java index 0550f0adb..cd4c2ee05 100644 --- a/src/main/java/fiji/plugin/trackmate/util/TMUtils.java +++ b/src/main/java/fiji/plugin/trackmate/util/TMUtils.java @@ -745,7 +745,7 @@ public static File proposeTrackMateSaveFile( final Settings settings, final Logg */ settings.imageFolder = settings.imp.getOriginalFileInfo().directory; } - else if ( !settings.imageFolder.isEmpty() ) + else if ( null != settings.imageFolder && !settings.imageFolder.isEmpty() ) { final String absolutePath = FileSystems.getDefault().getPath( settings.imageFolder ).normalize().toAbsolutePath().toString(); folder = new File( absolutePath );