From 21ba09db74bfb9fa281b8a192be809768ed6f971 Mon Sep 17 00:00:00 2001 From: ErickRyu Date: Wed, 17 Jul 2024 17:01:48 +0900 Subject: [PATCH] Add null coalescing for startDateTime and endDateTime in LTI_Lineitem --- src/lti/LTI_Lineitem.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lti/LTI_Lineitem.php b/src/lti/LTI_Lineitem.php index ba8e20a7..8608970a 100644 --- a/src/lti/LTI_Lineitem.php +++ b/src/lti/LTI_Lineitem.php @@ -19,8 +19,8 @@ public function __construct(array $lineitem = null) { $this->label = $lineitem["label"]; $this->resource_id = $lineitem["resourceId"]; $this->tag = $lineitem["tag"]; - $this->start_date_time = $lineitem["startDateTime"]; - $this->end_date_time = $lineitem["endDateTime"]; + $this->start_date_time = $lineitem["startDateTime"] ?? null; + $this->end_date_time = $lineitem["endDateTime"] ?? null; } /**