Skip to content

Firefly III: a personal finances manager

Catch undefined index in account repository.

James Coleb4c2631ef73b
diff --git a/app/Repositories/Account/AccountRepository.php b/app/Repositories/Account/AccountRepository.php
index a1443a41bb..7926b18778 100644
--- a/app/Repositories/Account/AccountRepository.php
+++ b/app/Repositories/Account/AccountRepository.php
@@ -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.');