From 5c2679f95ded80439d32d269814ef3eb7db877e9 Mon Sep 17 00:00:00 2001 From: Alexander Brandes Date: Wed, 10 Aug 2022 09:47:53 +0200 Subject: [PATCH] Update Upstream 55e2d3d Catch InvalidPathException in safeFile handler (2167) Closes #1872 --- .../src/main/java/com/sk89q/worldedit/WorldEdit.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java b/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java index b550d911a..ab2037ec0 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java @@ -85,6 +85,7 @@ import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.nio.charset.StandardCharsets; +import java.nio.file.InvalidPathException; import java.nio.file.Path; import java.nio.file.Paths; import java.util.HashMap; @@ -369,7 +370,7 @@ public final class WorldEdit { } return filePath.toFile(); - } catch (IOException e) { + } catch (IOException | InvalidPathException e) { throw new FilenameResolutionException(filename, Caption.of("worldedit.error.file-resolution.resolve-failed")); } }