summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValentin Popov <info@valentineus.link>2017-10-26 17:28:34 +0300
committerValentin Popov <info@valentineus.link>2017-10-26 17:28:34 +0300
commit21ad3135c8213cde62e8513dcfe4e5e299847d85 (patch)
treef79e9afde01b75cd829780bf888ab6a5bfd239ae
parentf87b2c82c949b828b3895c25262d91f7b45aff5c (diff)
downloadlocal_webhooks-21ad3135c8213cde62e8513dcfe4e5e299847d85.tar.xz
local_webhooks-21ad3135c8213cde62e8513dcfe4e5e299847d85.zip
Bug fix
-rw-r--r--classes/forms.php5
1 files changed, 4 insertions, 1 deletions
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);
}