Permalink
Browse files

MDL-32308 Fix error when testing id of guest user

  • Loading branch information...
1 parent 4b3ee4f commit 4d6bcdad3ef436745a53332278695ce16a94f7c1 Hugh Davenport committed with skodak Apr 9, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/enrollib.php
View
@@ -257,8 +257,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 4d6bcda

Please sign in to comment.