From 9308f74d006527fab1735f565b6177c7cc2f18e4 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Tue, 21 Nov 2017 11:31:23 +0400 Subject: Additional conditions check --- classes/observer.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'classes/observer.php') diff --git a/classes/observer.php b/classes/observer.php index cfa1829..8c80fab 100644 --- a/classes/observer.php +++ b/classes/observer.php @@ -53,7 +53,11 @@ class observer { */ private static function monkey_patch_bigbluebuttonbn($instanceid = 0) { global $DB; + $module = $DB->get_record("bigbluebuttonbn", array("id" => $instanceid)); - $DB->set_field("event", "timeduration", ($module->closingtime - $module->openingtime), array("modulename" => "bigbluebuttonbn", "instance" => $instanceid)); + + if ($module->closingtime != 0) { + $DB->set_field("event", "timeduration", ($module->closingtime - $module->openingtime), array("modulename" => "bigbluebuttonbn", "instance" => $instanceid)); + } } } \ No newline at end of file -- cgit v1.2.3