Update PreviewController

The constructor is called with the userId. However if a user is not
logged in this is null. Which means that we get an exception instead of
this being handled gracefully in the middleware.

There are cleaner solutions. But this is the solution that is the
easiest to apply without lots of work and risk of breaking things
(handling the logged in middleware before initializing the controller
etc).

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
pull/16571/head
Roeland Jago Douma 7 years ago
parent 4986241873
commit a2a53848b0
No known key found for this signature in database
GPG Key ID: F941078878347C0C
  1. 7
      core/Controller/PreviewController.php

@ -48,9 +48,6 @@ class PreviewController extends Controller {
/** @var IPreview */
private $preview;
/** @var ITimeFactory */
private $timeFactory;
/**
* PreviewController constructor.
*
@ -65,15 +62,13 @@ class PreviewController extends Controller {
IRequest $request,
IPreview $preview,
IRootFolder $root,
string $userId,
ITimeFactory $timeFactory
?string $userId
) {
parent::__construct($appName, $request);
$this->preview = $preview;
$this->root = $root;
$this->userId = $userId;
$this->timeFactory = $timeFactory;
}
/**

Loading…
Cancel
Save