Fix null pointer.

This commit is contained in:
James Cole 2018-03-07 20:41:17 +01:00
parent 99f5151aab
commit 49d0ed0c1b
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E

View File

@ -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'),