No check if no accounts submitted.

This commit is contained in:
James Cole 2019-12-22 07:50:21 +01:00
parent 4111973a06
commit dfca5b8722
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E

View File

@ -100,6 +100,14 @@ trait TransactionValidation
$transactionType = $transaction['type'] ?? $originalType;
$accountValidator->setTransactionType($transactionType);
// if no account types are given, just skip the check.
if (!isset($transaction['source_id'])
&& !isset($transaction['source_name'])
&& !isset($transaction['destination_id'])
&& !isset($transaction['destination_name'])) {
continue;
}
// validate source account.
$sourceId = isset($transaction['source_id']) ? (int)$transaction['source_id'] : $originalData['source_id'];
$sourceName = $transaction['source_name'] ?? $originalData['source_name'];