From 204a2fc34537e5ea5fe07d1525fb4a77631f9983 Mon Sep 17 00:00:00 2001 From: Pierre Maurice Schwang Date: Sun, 16 Jun 2024 18:09:48 +0200 Subject: [PATCH] chore: add null check again --- .../core/extent/clipboard/io/FastSchematicReaderV3.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/io/FastSchematicReaderV3.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/io/FastSchematicReaderV3.java index fdffc1501..32e6f5289 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/io/FastSchematicReaderV3.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/io/FastSchematicReaderV3.java @@ -24,12 +24,14 @@ import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.world.block.BlockTypesCache; import it.unimi.dsi.fastutil.io.FastBufferedInputStream; import org.apache.logging.log4j.Logger; +import org.checkerframework.checker.nullness.qual.NonNull; import java.io.BufferedInputStream; import java.io.DataInputStream; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; +import java.util.Objects; import java.util.OptionalInt; import java.util.UUID; import java.util.function.BiConsumer; @@ -65,7 +67,8 @@ public class FastSchematicReaderV3 implements ClipboardReader { private boolean needAdditionalIterate = true; - public FastSchematicReaderV3(InputStream stream) throws IOException { + public FastSchematicReaderV3(@NonNull InputStream stream) throws IOException { + Objects.requireNonNull(stream, "stream"); if (stream instanceof FileInputStream fileInputStream) { stream = new ResettableFileInputStream(fileInputStream); } else if (!stream.markSupported()) {