From b5d811f85cd7338f911acfd6581465b2c6699e1e Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Mon, 28 Nov 2016 16:47:00 +0800 Subject: [PATCH] MDL-56682 mod_assign: ensure the variable is not null --- 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 cbd30394baf..05279ba3ddd 100644 --- a/mod/assign/locallib.php +++ b/mod/assign/locallib.php @@ -4513,7 +4513,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;