Refactored AddressBookGetContact to produce an error rather than returning null if the contact does not exist.

This commit is contained in:
netkas 2025-03-26 15:12:09 -04:00
parent 4bad2d42cf
commit 463e86f59f
Signed by: netkas
GPG key ID: 4D8629441B76E4CC

View file

@ -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));