diff --git a/src/main/java/org/opentripplanner/model/plan/LegTimes.java b/src/main/java/org/opentripplanner/model/plan/LegTimes.java index e6614b2ed01..06b2fb3662b 100644 --- a/src/main/java/org/opentripplanner/model/plan/LegTimes.java +++ b/src/main/java/org/opentripplanner/model/plan/LegTimes.java @@ -2,6 +2,7 @@ import java.time.Duration; import java.time.ZonedDateTime; +import java.util.Objects; import javax.annotation.Nonnull; import javax.annotation.Nullable; @@ -10,6 +11,9 @@ public record LegTimes( @Nullable ZonedDateTime actual, @Nullable Duration delay ) { + public LegTimes { + Objects.requireNonNull(scheduled); + } @Nonnull public static LegTimes of(ZonedDateTime realtime, int delaySecs) { var delay = Duration.ofSeconds(delaySecs);