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.
This commit is contained in:
Eloy Lafuente (stronk7)
2016-01-20 10:05:38 +08:00
committed by Andrew Nicols
parent 0ef9c59d09
commit e2baf7ed8a
+1 -1
View File
@@ -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;