From d7185f59256e4ebf7a311d40b563c60193ff59be Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Tue, 20 Mar 2018 04:42:44 +0400 Subject: Minor bug fixed Signed-off-by: Valentin Popov --- lib.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib.php') diff --git a/lib.php b/lib.php index e668c04..d2550af 100644 --- a/lib.php +++ b/lib.php @@ -114,7 +114,9 @@ function local_webhooks_get_record($serviceid) { $record = $DB->get_record(LOCAL_WEBHOOKS_TABLE_SERVICES, array("id" => $serviceid), "*", IGNORE_MISSING); /* Loads service events */ - $record->events = local_webhooks_get_list_events_for_service($serviceid); + if (!empty($record)) { + $record->events = local_webhooks_get_list_events_for_service($serviceid); + } return $record; } -- cgit v1.2.3