From f97eb62176f34d2a476af5a7131322985a0f0518 Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Mon, 7 Aug 2023 10:34:02 +0100 Subject: [PATCH 1/2] Handle root directory --- .../org/openmicroscopy/shoola/env/ui/DownloadActivity.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/org/openmicroscopy/shoola/env/ui/DownloadActivity.java b/src/main/java/org/openmicroscopy/shoola/env/ui/DownloadActivity.java index 5ed106332..f4c5e702f 100644 --- a/src/main/java/org/openmicroscopy/shoola/env/ui/DownloadActivity.java +++ b/src/main/java/org/openmicroscopy/shoola/env/ui/DownloadActivity.java @@ -108,6 +108,10 @@ private String getFileName() { File directory = folder; directory = folder.getParentFile(); + if (directory == null) { //root directory + // reset + directory = folder + } File[] files = directory.listFiles(); String dirPath = directory.getAbsolutePath() + File.separator; From 79fd9d9fe72931c5b34807e16b4b79b2e7c6ed77 Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Mon, 7 Aug 2023 15:07:37 +0100 Subject: [PATCH 2/2] add missing ; --- .../java/org/openmicroscopy/shoola/env/ui/DownloadActivity.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/openmicroscopy/shoola/env/ui/DownloadActivity.java b/src/main/java/org/openmicroscopy/shoola/env/ui/DownloadActivity.java index f4c5e702f..efa6a55e7 100644 --- a/src/main/java/org/openmicroscopy/shoola/env/ui/DownloadActivity.java +++ b/src/main/java/org/openmicroscopy/shoola/env/ui/DownloadActivity.java @@ -110,7 +110,7 @@ private String getFileName() { directory = folder.getParentFile(); if (directory == null) { //root directory // reset - directory = folder + directory = folder; } File[] files = directory.listFiles();