From ecc7b969a40bf9064a42348d4521461013ae6877 Mon Sep 17 00:00:00 2001 From: Fabian Vogler Date: Sat, 4 Jan 2025 18:54:57 +0200 Subject: [PATCH] Check for non-existing duration Default to zero --- lib/Transport/Entity/Schedule/Connection.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Transport/Entity/Schedule/Connection.php b/lib/Transport/Entity/Schedule/Connection.php index 5f7691f..71b4d1d 100644 --- a/lib/Transport/Entity/Schedule/Connection.php +++ b/lib/Transport/Entity/Schedule/Connection.php @@ -154,7 +154,7 @@ public static function createFromJson($json, self $obj = null) $obj->to->platform = $json->legs[count($json->legs) - 2]->exit->track; } - $obj->duration = gmdate('0z\dH:i:s', $json->duration); + $obj->duration = gmdate('0z\dH:i:s', $json->duration ?? 0); $numberOfVehicles = 0; foreach ($json->legs as $leg) {