Skip to content

Commit

Permalink
Revert "ActivityManager can be initialized with null for the session …
Browse files Browse the repository at this point in the history
…variable in the ctor"

This reverts commit debb142.
  • Loading branch information
DeepDiver1975 committed Jul 17, 2017
1 parent 430aa25 commit 2cf02a0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 529 deletions.
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 = null,
IUserSession $session,
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 !== null && $this->session->getUser() instanceof IUser) {
if ($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 === null || !$this->session->isLoggedIn()) {
} else if (!$this->session->isLoggedIn()) {
return $this->getUserFromToken();
} else {
return $this->session->getUser()->getUID();
Expand Down
Loading

0 comments on commit 2cf02a0

Please sign in to comment.