diff --git a/lib/Service/CredentialService.php b/lib/Service/CredentialService.php index 9dbf8f33..e30f3d67 100644 --- a/lib/Service/CredentialService.php +++ b/lib/Service/CredentialService.php @@ -45,7 +45,8 @@ class CredentialService { } public function getRandomCredentialByVaultId($vault_id, $user_id) { - return array_pop($this->credentialMapper->getRandomCredentialByVaultId($vault_id, $user_id)); + $credentials = $this->credentialMapper->getRandomCredentialByVaultId($vault_id, $user_id); + return array_pop($credentials); } public function getExpiredCredentials($timestamp) {