From 39d77091d98571526263dddefd3e79307f944c2b Mon Sep 17 00:00:00 2001 From: Pierre Maurice Schwang Date: Mon, 16 May 2022 14:23:21 +0200 Subject: [PATCH] Don't error when loading a schematic fails (#1744) fix: Throwable#getMessage may be null --- .../java/com/sk89q/worldedit/command/SchematicCommands.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SchematicCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SchematicCommands.java index 4065c56ad..af3235205 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SchematicCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SchematicCommands.java @@ -87,6 +87,7 @@ import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.UUID; import java.util.concurrent.Callable; import java.util.regex.Pattern; @@ -399,7 +400,7 @@ public class SchematicCommands { } catch (IllegalArgumentException e) { actor.print(Caption.of("worldedit.schematic.unknown-filename", TextComponent.of(filename))); } catch (URISyntaxException | IOException e) { - actor.print(Caption.of("worldedit.schematic.file-not-exist", TextComponent.of(e.getMessage()))); + actor.print(Caption.of("worldedit.schematic.file-not-exist", TextComponent.of(Objects.toString(e.getMessage())))); LOGGER.warn("Failed to load a saved clipboard", e); } finally { if (in != null) {