Commit 538893f2 authored by Alastair Pharo's avatar Alastair Pharo Committed by Alastair Pharo
Browse files

Martyn's fix for throwing exceptions before the USER object is created

parent 3ceceba2
...@@ -495,7 +495,7 @@ function print_object($mixed) { ...@@ -495,7 +495,7 @@ function print_object($mixed) {
*/ */
function current_language() { function current_language() {
global $USER, $CFG; global $USER, $CFG;
if (null !== ($lang = $USER->get_account_preference('lang'))) { if ($USER instanceof User && null !== ($lang = $USER->get_account_preference('lang'))) {
return $lang; return $lang;
} }
if (!empty($CFG->lang)) { if (!empty($CFG->lang)) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment