Skip to content
Snippets Groups Projects
Commit ff96d94d authored by Jan Kožusznik's avatar Jan Kožusznik
Browse files

fix: NPE during click into empty workspace, not existent directory

parent 2f545557
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,7 @@ import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
......@@ -61,7 +62,9 @@ public class ManageSPIMBenchmark implements Command {
public void run() {
try {
Path workingDirPath = Paths.get(workingDirectory.getPath());
if (!Files.isDirectory(workingDirPath)) {
Files.createDirectories(workingDirPath);
}
FileLock fl = new FileLock(workingDirPath.resolve(LOCK_FILE_NAME));
if(!fl.tryLock()) {
uiService.showDialog("Working directory is already used by someone else", MessageType.ERROR_MESSAGE);
......
......@@ -143,7 +143,7 @@ public class BenchmarkSPIMControl extends BorderPane implements CloseableControl
job -> JavaFXRoutines.notNullValue(job,
j -> !j.isUseDemoData()
&& !EnumSet.of(JobState.Running, JobState.Disposed).contains(j.getState())),
job -> job.getUploadProgress().isWorking());
job -> job != null && job.getUploadProgress().isWorking());
menu.addItem("Download result",
job -> executeWSCallAsync("Downloading data", p -> job.getValue().startDownload()),
job -> executeWSCallAsync("Stop downloading data", p -> job.getValue().stopDownload()),
......@@ -151,7 +151,7 @@ public class BenchmarkSPIMControl extends BorderPane implements CloseableControl
.notNullValue(job,
j -> EnumSet.of(JobState.Failed, JobState.Finished, JobState.Canceled)
.contains(j.getState()) && j.canBeDownloaded()),
job -> job.getDownloadProgress().isWorking());
job -> job != null && job.getDownloadProgress().isWorking());
menu.addItem("Download statistics",
job -> executeWSCallAsync("Downloading data", p -> job.getValue().downloadStatistics(p)),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment