Skip to content

Commit

Permalink
Fix returning bool in Customer::findByExternalId() (#91)
Browse files Browse the repository at this point in the history
Co-authored-by: Vojtěch Dobeš <[email protected]>
  • Loading branch information
ftipalek and vojtech-dobes authored Sep 6, 2021
1 parent 2405456 commit 5e19c12
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,10 @@ public static function findByExternalId($externalId, ClientInterface $client = n

$response = self::all($externalId, $client);

if ($response instanceof Collection) {
if (
$response instanceof Collection
&& !$response->isEmpty()
) {
return $response->first();
}

Expand Down

0 comments on commit 5e19c12

Please sign in to comment.