From 03c7c3b5b072f6baee2d0bb15d676157963e1c01 Mon Sep 17 00:00:00 2001 From: Jonathan Champ Date: Thu, 19 Sep 2024 11:32:34 -0400 Subject: [PATCH] webservice: use string 'null' when recording_type is null This allows the data to be loaded in the database and not throw an exception. In theory, the value should never be null, but somehow it is for one of our users. In the rare case where this occurs, Moodle may show the string "null", but I'm not too worried about that being the worst-case. --- classes/webservice.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/classes/webservice.php b/classes/webservice.php index f8cc63ba..fc6aa5e9 100644 --- a/classes/webservice.php +++ b/classes/webservice.php @@ -1070,7 +1070,7 @@ public function get_recording_url_list($meetingid) { $recordinginfo->meetinguuid = $response->uuid; $recordinginfo->url = $url; $recordinginfo->filetype = $recording->file_type; - $recordinginfo->recordingtype = $recording->recording_type; + $recordinginfo->recordingtype = $recording->recording_type ?? 'null'; $recordinginfo->passcode = $response->password; $recordinginfo->recordingstart = strtotime($recording->recording_start); @@ -1120,7 +1120,7 @@ public function get_user_recordings($userid, $from, $to) { $recordinginfo->meetinguuid = $meeting->uuid; $recordinginfo->url = $url; $recordinginfo->filetype = $recording->file_type; - $recordinginfo->recordingtype = $recording->recording_type; + $recordinginfo->recordingtype = $recording->recording_type ?? 'null'; $recordinginfo->recordingstart = strtotime($recording->recording_start); $recordings[$recording->id] = $recordinginfo;