diff --git a/classlib/src/main/java/org/teavm/classlib/java/util/TOptional.java b/classlib/src/main/java/org/teavm/classlib/java/util/TOptional.java index 901bfe817..a0f472e67 100644 --- a/classlib/src/main/java/org/teavm/classlib/java/util/TOptional.java +++ b/classlib/src/main/java/org/teavm/classlib/java/util/TOptional.java @@ -63,7 +63,7 @@ public final class TOptional { } public TStream stream() { - if (!isPresent()) { + if (value == null) { return TStream.empty(); } else { return TStream.of(value);