Don't error when loading a schematic fails (#1744)

fix: Throwable#getMessage may be null
This commit is contained in:
Pierre Maurice Schwang 2022-05-16 14:23:21 +02:00 committed by GitHub
parent 2c1ffd4ef4
commit 39d77091d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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) {