From 21ad3135c8213cde62e8513dcfe4e5e299847d85 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Thu, 26 Oct 2017 18:28:34 +0400 Subject: Bug fix --- classes/forms.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'classes') diff --git a/classes/forms.php b/classes/forms.php index 2e38e70..5e75050 100644 --- a/classes/forms.php +++ b/classes/forms.php @@ -52,7 +52,10 @@ class service_edit_form extends moodleform { * @param object $record */ public function set_data($record) { - $record->events = unserialize(gzuncompress(base64_decode($record->events))); + if (!empty($record->events)) { + $record->events = unserialize(gzuncompress(base64_decode($record->events))); + } + return parent::set_data($record); } -- cgit v1.2.3