Skip to content

Commit

Permalink
MDL-67024 Lib: Check if user->mnethostid is set before using it
Browse files Browse the repository at this point in the history
  • Loading branch information
farhan6318 committed Mar 20, 2020
1 parent 4980533 commit 20ecbc8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/pagelib.php
Expand Up @@ -1611,7 +1611,8 @@ protected function resolve_theme() {
}

$mnetpeertheme = '';
if (isloggedin() and isset($CFG->mnet_localhost_id) and $USER->mnethostid != $CFG->mnet_localhost_id) {
$mnetvarsok = isset($CFG->mnet_localhost_id) && isset($USER->mnethostid);
if (isloggedin() and $mnetvarsok and $USER->mnethostid != $CFG->mnet_localhost_id) {
require_once($CFG->dirroot.'/mnet/peer.php');
$mnetpeer = new mnet_peer();
$mnetpeer->set_id($USER->mnethostid);
Expand Down

0 comments on commit 20ecbc8

Please sign in to comment.