Refactored AddressBookGetContact to produce an error rather than returning null if the contact does not exist.
This commit is contained in:
parent
4bad2d42cf
commit
463e86f59f
1 changed files with 1 additions and 1 deletions
|
@ -35,7 +35,7 @@
|
||||||
{
|
{
|
||||||
if(!ContactManager::isContact($request->getPeer(), $peerAddress))
|
if(!ContactManager::isContact($request->getPeer(), $peerAddress))
|
||||||
{
|
{
|
||||||
return $rpcRequest->produceResponse();
|
return $rpcRequest->produceError(StandardError::NOT_FOUND, sprintf('The requested contact for %s does not exist', $peerAddress->getAddress()));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $rpcRequest->produceResponse(ContactManager::getStandardContact($request->getPeer(), $peerAddress));
|
return $rpcRequest->produceResponse(ContactManager::getStandardContact($request->getPeer(), $peerAddress));
|
||||||
|
|
Loading…
Add table
Reference in a new issue