diff --git a/stream/src/main/java/com/annimon/stream/Exceptional.java b/stream/src/main/java/com/annimon/stream/Exceptional.java index 831a9bf6..1b9d7315 100644 --- a/stream/src/main/java/com/annimon/stream/Exceptional.java +++ b/stream/src/main/java/com/annimon/stream/Exceptional.java @@ -43,6 +43,7 @@ public class Exceptional { */ @NotNull public static Exceptional of(@NotNull ThrowableSupplier supplier) { + Objects.requireNonNull(supplier); try { return new Exceptional(supplier.get(), null); } catch (Throwable throwable) { @@ -60,6 +61,7 @@ public static Exceptional of(@NotNull ThrowableSupplier sup @NotNull @Contract("_ -> new") public static Exceptional of(@NotNull Throwable throwable) { + Objects.requireNonNull(throwable); return new Exceptional(null, throwable); }