Skip to content
This repository was archived by the owner on Nov 25, 2020. It is now read-only.

Commit 16577ae

Browse files
committed
Avoid error trying to load binary without any user logged - See #946
1 parent 8129433 commit 16577ae

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

core/src/plugins/core.conf/class.AbstractConfDriver.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1240,8 +1240,10 @@ public function switchAction($action, $httpVars, $fileVars)
12401240
} else if (isSet($httpVars["binary_id"])) {
12411241
if (isSet($httpVars["user_id"]) && AuthService::getLoggedUser() != null && AuthService::getLoggedUser()->isAdmin()) {
12421242
$context = array("USER" => $httpVars["user_id"]);
1243-
} else {
1243+
} else if(AuthService::getLoggedUser() !== null) {
12441244
$context = array("USER" => AuthService::getLoggedUser()->getId());
1245+
} else {
1246+
$context = array();
12451247
}
12461248
$this->loadBinary($context, $httpVars["binary_id"]);
12471249
}

0 commit comments

Comments
 (0)