diff --git a/lib/conditionlib.php b/lib/conditionlib.php index a52514941b7..87ad57a6cd7 100644 --- a/lib/conditionlib.php +++ b/lib/conditionlib.php @@ -1324,7 +1324,7 @@ abstract class condition_info_base { } $iscurrentuser = $USER->id == $userid; - if (isguestuser($userid)) { + if (isguestuser($userid) || ($iscurrentuser && !isloggedin())) { // Must be logged in and can't be the guest. (this should never happen anyway) return false; }