From 5e5a774e34362c1140b1dad2126cee4715c0fec4 Mon Sep 17 00:00:00 2001 From: Dmitry Isaenko Date: Fri, 6 Nov 2020 22:26:35 +0300 Subject: [PATCH] Fix #81 --- src/main/java/nsusbloader/FilesHelper.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/nsusbloader/FilesHelper.java b/src/main/java/nsusbloader/FilesHelper.java index 7988a06..53771dc 100644 --- a/src/main/java/nsusbloader/FilesHelper.java +++ b/src/main/java/nsusbloader/FilesHelper.java @@ -24,9 +24,12 @@ import java.nio.file.Paths; public class FilesHelper { public static String getRealFolder(String location){ - Path locationAsPath = Paths.get(location); - if (Files.notExists(locationAsPath) || Files.isRegularFile(locationAsPath)) - return System.getProperty("user.home"); + try{ + Path locationAsPath = Paths.get(location); + if (Files.notExists(locationAsPath) || Files.isRegularFile(locationAsPath)) + return System.getProperty("user.home"); + } + catch (Exception ignored){} return location; } }