MDL-56682 mod_assign: ensure the variable is not null

This commit is contained in:
Mark Nelson 2016-11-28 16:47:00 +08:00
parent 3eabedbb92
commit 4a8c6b4259

View file

@ -4793,7 +4793,7 @@ class assign {
$cangrade = has_capability('mod/assign:grade', $this->get_context());
// If there is a visible grade, show the summary.
if ((!is_null($gradebookgrade->grade) || !$emptyplugins)
if (!is_null($gradebookgrade) && (!is_null($gradebookgrade->grade) || !$emptyplugins)
&& ($cangrade || !$gradebookgrade->hidden)) {
$gradefordisplay = null;