diff --git a/src/Wallabag/CoreBundle/Controller/WallabagRestController.php b/src/Wallabag/CoreBundle/Controller/WallabagRestController.php index 3cfb8a778..e9cd8c939 100644 --- a/src/Wallabag/CoreBundle/Controller/WallabagRestController.php +++ b/src/Wallabag/CoreBundle/Controller/WallabagRestController.php @@ -33,7 +33,7 @@ class WallabagRestController extends Controller throw $this->createNotFoundException(); } - return array($user->getSalt()); + return array($user->getSalt() ?: null); } /** * Retrieve all entries. It could be filtered by many options. diff --git a/src/Wallabag/CoreBundle/Tests/Controller/WallabagRestControllerTest.php b/src/Wallabag/CoreBundle/Tests/Controller/WallabagRestControllerTest.php index 298cf10c1..815903fad 100644 --- a/src/Wallabag/CoreBundle/Tests/Controller/WallabagRestControllerTest.php +++ b/src/Wallabag/CoreBundle/Tests/Controller/WallabagRestControllerTest.php @@ -35,6 +35,7 @@ class WallabagRestControllerTest extends WallabagTestCase $client = $this->createClient(); $client->request('GET', '/api/salts/admin.json'); $this->assertEquals(200, $client->getResponse()->getStatusCode()); + $this->assertNotEmpty(json_decode($client->getResponse()->getContent())); $client->request('GET', '/api/salts/notfound.json'); $this->assertEquals(404, $client->getResponse()->getStatusCode());