]> git.mjollnir.org Git - moodle.git/commitdiff
After rebuilding cache - get the course record again
authormoodler <moodler>
Fri, 22 Aug 2003 16:20:35 +0000 (16:20 +0000)
committermoodler <moodler>
Fri, 22 Aug 2003 16:20:35 +0000 (16:20 +0000)
course/view.php

index 0fec158dfe2141846f1a3a782e244fc998bd5d16..165b9032514417c65f3a4b7156e7fb1263a7e589 100644 (file)
@@ -92,6 +92,9 @@
 
     if (empty($course->modinfo)) {       // Course cache was never made
         rebuild_course_cache($course->id);
+        if (! $course = get_record("course", "id", $course->id) ) {
+            error("That's an invalid course id");
+        }
     }
 
     if (!file_exists("$CFG->dirroot/course/format/$course->format.php")) {   // Default format is weeks