Skip to content

Commit 98b307c

Browse files
committed
Handle candidate error
1 parent 7d832dc commit 98b307c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/AddressValidation.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ public function validate(String $client_id, String $client_secret)
7474
return ['status' => 'fail', 'msg' => $error];
7575
}
7676

77+
if (!isset($res->XAVResponse->Candidate)) {
78+
return ['status' => 'fail', 'msg' => "Invalid Address."];
79+
}
80+
7781
$addresses = $this->_getAddresses($res->XAVResponse->Candidate);
7882
return ['status' => 'success', 'addresses' => $addresses];
7983
}

0 commit comments

Comments
 (0)