]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-12934 temporary fix for grade items of activities without proper course module...
authorskodak <skodak>
Sun, 17 Feb 2008 18:38:44 +0000 (18:38 +0000)
committerskodak <skodak>
Sun, 17 Feb 2008 18:38:44 +0000 (18:38 +0000)
grade/lib.php

index 7e8e834a9064c7a599381607068eb7972425e655..2a3becfbeec2ffc1d0a769a1c7421e6043a3f7dd 100644 (file)
@@ -852,7 +852,9 @@ class grade_structure {
         $iteminstance = $element['object']->iteminstance;
 
         if ($withlink and $itemtype=='mod' and $iteminstance and $itemmodule) {
-            $cm = get_coursemodule_from_instance($itemmodule, $iteminstance, $this->courseid);
+            if (!$cm = get_coursemodule_from_instance($itemmodule, $iteminstance, $this->courseid)) {
+                continue;
+            }
 
             $dir = $CFG->dirroot.'/mod/'.$itemmodule;