Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable10] ActivityManager can be initialized with null for the sessi… #28420

Merged
merged 2 commits into from
Jul 19, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/private/Activity/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class Manager implements IManager {
* @param IConfig $config
*/
public function __construct(IRequest $request,
IUserSession $session,
IUserSession $session = null,
IConfig $config) {
$this->request = $request;
$this->session = $session;
Expand Down Expand Up @@ -177,7 +177,7 @@ public function publish(IEvent $event) {
}

if ($event->getAuthor() === null) {
if ($this->session->getUser() instanceof IUser) {
if ($this->session !== null && $this->session->getUser() instanceof IUser) {
$event->setAuthor($this->session->getUser()->getUID());
}
}
Expand Down Expand Up @@ -501,7 +501,7 @@ public function setCurrentUserId($currentUserId) {
public function getCurrentUserId() {
if ($this->currentUserId !== null) {
return $this->currentUserId;
} else if (!$this->session->isLoggedIn()) {
} else if ($this->session === null || !$this->session->isLoggedIn()) {
return $this->getUserFromToken();
} else {
return $this->session->getUser()->getUID();
Expand Down
2 changes: 1 addition & 1 deletion lib/private/DB/MigrationService.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ function __construct($appName,
}

// load the app so that app code can be used during migrations
\OC_App::loadApp($this->appName);
\OC_App::loadApp($this->appName, false);
}

private static function requireOnce($file) {
Expand Down
Loading