FIxed another ossible notice during upgrade

This commit is contained in:
moodler 2006-08-14 13:44:10 +00:00
parent abaeae30f7
commit 10f5c89035

View file

@ -123,7 +123,7 @@ function has_capability($capability, $context=NULL, $userid=NULL) {
if ($userid && $userid != $USER->id) { // loading other user's capability if ($userid && $userid != $USER->id) { // loading other user's capability
$capabilities = load_user_capability($capability, $context, $userid); $capabilities = load_user_capability($capability, $context, $userid);
} else { } else {
$capabilities = $USER->capabilities; $capabilities = empty($USER->capabilities) ? NULL : $USER->capabilities;
} }
if (empty($context)) { // Use default CONTEXT if none specified if (empty($context)) { // Use default CONTEXT if none specified