diff --git a/classes/local/envbarlib.php b/classes/local/envbarlib.php index ced799e..f7a8b0b 100644 --- a/classes/local/envbarlib.php +++ b/classes/local/envbarlib.php @@ -677,8 +677,11 @@ public static function config() { // Email subject prefix. if (get_config('local_envbar', 'enableemailprefix')) { - $origprefix = $CFG->emailsubjectprefix; - $CFG->emailsubjectprefix = '[' . substr($match->showtext, 0, 4) . '] ' . $origprefix; + // Only do something if this config exists. + if (isset($CFG->emailsubjectprefix)) { + $origprefix = $CFG->emailsubjectprefix; + $CFG->emailsubjectprefix = '[' . substr($match->showtext, 0, 4) . '] ' . $origprefix; + } } }