Skip to content

Commit 2cf02a0

Browse files
committed
Revert "ActivityManager can be initialized with null for the session variable in the ctor"
This reverts commit debb142.
1 parent 430aa25 commit 2cf02a0

File tree

2 files changed

+3
-529
lines changed

2 files changed

+3
-529
lines changed

lib/private/Activity/Manager.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class Manager implements IManager {
5959
* @param IConfig $config
6060
*/
6161
public function __construct(IRequest $request,
62-
IUserSession $session = null,
62+
IUserSession $session,
6363
IConfig $config) {
6464
$this->request = $request;
6565
$this->session = $session;
@@ -177,7 +177,7 @@ public function publish(IEvent $event) {
177177
}
178178

179179
if ($event->getAuthor() === null) {
180-
if ($this->session !== null && $this->session->getUser() instanceof IUser) {
180+
if ($this->session->getUser() instanceof IUser) {
181181
$event->setAuthor($this->session->getUser()->getUID());
182182
}
183183
}
@@ -501,7 +501,7 @@ public function setCurrentUserId($currentUserId) {
501501
public function getCurrentUserId() {
502502
if ($this->currentUserId !== null) {
503503
return $this->currentUserId;
504-
} else if ($this->session === null || !$this->session->isLoggedIn()) {
504+
} else if (!$this->session->isLoggedIn()) {
505505
return $this->getUserFromToken();
506506
} else {
507507
return $this->session->getUser()->getUID();

0 commit comments

Comments
 (0)