From: Petr Skoda Date: Wed, 29 Sep 2010 21:09:19 +0000 (+0000) Subject: MDL-24445 fixed problem with uninitialised PAGE object X-Git-Tag: v2.0.0-rc2~800 X-Git-Url: http://git.moodle.org/gw?p=moodle.git;a=commitdiff_plain;h=9b540305dfa3eefe04583efd8c40703cd989e496 MDL-24445 fixed problem with uninitialised PAGE object --- diff --git a/lib/weblib.php b/lib/weblib.php index 63fb88e5614..0363501f9a9 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -2519,7 +2519,9 @@ function redirect($url, $message='', $delay=-1) { } // prevent debug errors - make sure context is properly initialised - $PAGE->set_context(null); + if ($PAGE) { + $PAGE->set_context(null); + } if ($url instanceof moodle_url) { $url = $url->out(false);