Permalink
Browse files

MDL-32308 Fix error when testing id of guest user

  • Loading branch information...
1 parent f24ff8f commit 2719e7c8f9af5db0e588064d8a5ce4429f838f63 Hugh Davenport committed with skodak Apr 9, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/enrollib.php
View
@@ -264,8 +264,8 @@ function enrol_sharing_course($user1, $user2) {
function enrol_get_shared_courses($user1, $user2, $preloadcontexts = false, $checkexistsonly = false) {
global $DB, $CFG;
- $user1 = !empty($user1->id) ? $user1->id : $user1;
- $user2 = !empty($user2->id) ? $user2->id : $user2;
+ $user1 = isset($user1->id) ? $user1->id : $user1;
+ $user2 = isset($user2->id) ? $user2->id : $user2;
if (empty($user1) or empty($user2)) {
return false;

0 comments on commit 2719e7c

Please sign in to comment.