MDL-55161 assign: Check for existence of gradebook feedback plugin
authorMichael Aherne <michael.aherne@strath.ac.uk>
Fri, 8 Jul 2016 09:48:00 +0000 (10:48 +0100)
committerMichael Aherne <michael.aherne@strath.ac.uk>
Wed, 13 Jul 2016 08:01:45 +0000 (09:01 +0100)
mod/assign/locallib.php

index 2aa605d..8129066 100644 (file)
@@ -7978,6 +7978,10 @@ class assign {
         // Check if default gradebook feedback is visible and enabled.
         $gradebookfeedbackplugin = $this->get_feedback_plugin_by_type($gradebookplugin);
 
+        if (empty($gradebookfeedbackplugin)) {
+            return false;
+        }
+
         if ($gradebookfeedbackplugin->is_visible() && $gradebookfeedbackplugin->is_enabled()) {
             return true;
         }