From 0aff1c9268e760c2e1164f85ea8414ad0d1fa91c Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 29 Aug 2017 11:06:37 +0200 Subject: [PATCH] Return the user id in case of an error Signed-off-by: Joas Schilling --- core/Controller/AvatarController.php | 2 +- tests/Core/Controller/AvatarControllerTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/Controller/AvatarController.php b/core/Controller/AvatarController.php index cb0ece9fa4..e4d13d218a 100644 --- a/core/Controller/AvatarController.php +++ b/core/Controller/AvatarController.php @@ -143,7 +143,7 @@ class AvatarController extends Controller { } catch (\Exception $e) { $resp = new JSONResponse([ 'data' => [ - 'displayname' => '', + 'displayname' => $userId, ], ]); } diff --git a/tests/Core/Controller/AvatarControllerTest.php b/tests/Core/Controller/AvatarControllerTest.php index b87f73366f..1a1f113048 100644 --- a/tests/Core/Controller/AvatarControllerTest.php +++ b/tests/Core/Controller/AvatarControllerTest.php @@ -169,7 +169,7 @@ class AvatarControllerTest extends \Test\TestCase { //Comment out until JS is fixed //$this->assertEquals(Http::STATUS_NOT_FOUND, $response->getStatus()); $this->assertEquals(Http::STATUS_OK, $response->getStatus()); - $this->assertEquals('', $response->getData()['data']['displayname']); + $this->assertEquals('userDoesNotExist', $response->getData()['data']['displayname']); } /**