Catch undefined index in account repository.

This commit is contained in:
James Cole 2017-11-01 20:04:25 +01:00
parent e0a0dbb6da
commit b4c2631ef7
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E

View File

@ -507,7 +507,7 @@ class AccountRepository implements AccountRepositoryInterface
*/
protected function validOpeningBalanceData(array $data): bool
{
$data['openingBalance'] = strval($data['openingBalance']);
$data['openingBalance'] = strval($data['openingBalance'] ?? '');
if (isset($data['openingBalance']) && !is_null($data['openingBalance']) && strlen($data['openingBalance']) > 0 &&
isset($data['openingBalanceDate'])) {
Log::debug('Array has valid opening balance data.');