From 49d0ed0c1b1bfaa18d8ef7cfb4e8fc9a76ea6a36 Mon Sep 17 00:00:00 2001 From: James Cole Date: Wed, 7 Mar 2018 20:41:17 +0100 Subject: [PATCH] Fix null pointer. --- app/Http/Controllers/AccountController.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/Http/Controllers/AccountController.php b/app/Http/Controllers/AccountController.php index 98f3c8f978..585aec7ee4 100644 --- a/app/Http/Controllers/AccountController.php +++ b/app/Http/Controllers/AccountController.php @@ -185,7 +185,11 @@ class AccountController extends Controller // the opening balance is tricky: $openingBalanceAmount = strval($repository->getOpeningBalanceAmount($account)); $openingBalanceDate = $repository->getOpeningBalanceDate($account); + $default = app('amount')->getDefaultCurrency(); $currency = $this->currencyRepos->findNull(intval($account->getMeta('currency_id'))); + if (is_null($currency)) { + $currency = $default; + } $preFilled = [ 'accountNumber' => $account->getMeta('accountNumber'),