From 219369148e6afa2f0710d9fccda2abc9c20e9630 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 8 Aug 2018 12:11:33 +0200 Subject: Fix "Argument 1 passed to OC\Authentication\Token\Manager::getTokenById() must be of the type integer, null given" Signed-off-by: Joas Schilling --- lib/Controller/PushController.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/Controller/PushController.php b/lib/Controller/PushController.php index 4678e70..ce434ac 100644 --- a/lib/Controller/PushController.php +++ b/lib/Controller/PushController.php @@ -106,6 +106,9 @@ class PushController extends OCSController { } $tokenId = $this->session->get('token-id'); + if (!\is_int($tokenId)) { + return new DataResponse(['message' => 'INVALID_SESSION_TOKEN'], Http::STATUS_BAD_REQUEST); + } try { $token = $this->tokenProvider->getTokenById($tokenId); } catch (InvalidTokenException $e) { -- cgit v1.2.3