From 827cc13398cd4d69903ca600c1ef0386de57da9d Mon Sep 17 00:00:00 2001 From: Kleptoc Date: Tue, 3 May 2022 12:01:07 -0700 Subject: [PATCH] Fix for IllegalArgumentException on pathing --- src/main/java/com/rarchives/ripme/utils/Utils.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/rarchives/ripme/utils/Utils.java b/src/main/java/com/rarchives/ripme/utils/Utils.java index 783f28cc..f0fdbd2c 100644 --- a/src/main/java/com/rarchives/ripme/utils/Utils.java +++ b/src/main/java/com/rarchives/ripme/utils/Utils.java @@ -322,7 +322,12 @@ public class Utils { * @return saveAs in relation to the CWD */ public static String removeCWD(Path saveAs) { - return saveAs.relativize(Paths.get(".").toAbsolutePath()).toString(); + try { + return saveAs.relativize(Paths.get(".").toAbsolutePath()).toString(); + } + catch (IllegalArgumentException e) { + return saveAs.toString(); + } } /**