From 8f8de2cc876209b3de45c2ce077c88ded2df59ea Mon Sep 17 00:00:00 2001
From: moodler <moodler>
Date: Mon, 22 Jan 2007 08:25:20 +0000
Subject: [PATCH] Made is_mnet_remote_user() a bit more robust        MDL-8253

---
 lib/moodlelib.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/moodlelib.php b/lib/moodlelib.php
index bfa5d10216..a6cb7004e8 100644
--- a/lib/moodlelib.php
+++ b/lib/moodlelib.php
@@ -6626,7 +6626,7 @@ function is_mnet_remote_user($user) {
         unset($env);
     }
 
-    return ($user->mnethostid != $CFG->mnet_localhost_id);
+    return (!empty($user->mnethostid) && $user->mnethostid != $CFG->mnet_localhost_id);
 }
 
 /**
-- 
2.39.5