From e2baf7ed8a9046f611fd44d7ab4e18f9bf9b46d2 Mon Sep 17 00:00:00 2001 From: "Eloy Lafuente (stronk7)" Date: Wed, 20 Jan 2016 02:50:15 +0100 Subject: [PATCH] MDL-50083 mod_assign: protect code against not set flags Yes could have used !empty() but for some reason found the isset() && condition more clear. Tired brain, surely. --- mod/assign/locallib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/assign/locallib.php b/mod/assign/locallib.php index fe7700e616e..09121a893e1 100644 --- a/mod/assign/locallib.php +++ b/mod/assign/locallib.php @@ -7163,7 +7163,7 @@ class assign { $this->update_submission($newsubmission, $userid, false, $this->get_instance()->teamsubmission); $flags = $this->get_user_flags($userid, false); - if ($flags->locked) { + if (isset($flags->locked) && $flags->locked) { // May not exist. $this->process_unlock_submission($userid); } return true;