getIban might return null from the bunq API. Fixes #1378 as it gets imported now :)

This commit is contained in:
Paul Sohier
2018-04-25 19:11:32 +02:00
parent 71f39f55f2
commit d2848cf569

View File

@@ -320,6 +320,8 @@ class BunqRoutine implements RoutineInterface
private function convertToAccount(LabelMonetaryAccount $party, string $expectedType): Account
{
Log::debug('in convertToAccount()');
if ($party->getIban() !== null) {
// find opposing party by IBAN first.
$result = $this->accountRepository->findByIbanNull($party->getIban(), [$expectedType]);
if (null !== $result) {
@@ -337,6 +339,8 @@ class BunqRoutine implements RoutineInterface
return $result;
}
}
}
// create new account:
$data = [
'user_id' => $this->job->user_id,