From 9b540305dfa3eefe04583efd8c40703cd989e496 Mon Sep 17 00:00:00 2001 From: Petr Skoda Date: Wed, 29 Sep 2010 21:09:19 +0000 Subject: [PATCH] MDL-24445 fixed problem with uninitialised PAGE object --- lib/weblib.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); -- 2.43.0