Skip to content

Firefly III: a personal finances manager

Fix nullpointer

James Cole03f39f53d80d
diff --git a/app/Api/V2/Controllers/Summary/BasicController.php b/app/Api/V2/Controllers/Summary/BasicController.php
index 9a3dec5fb7..ef5928819f 100644
--- a/app/Api/V2/Controllers/Summary/BasicController.php
+++ b/app/Api/V2/Controllers/Summary/BasicController.php
@@ -408,7 +408,7 @@ class BasicController extends Controller
// either an amount was budgeted or 0 is available.
$currency = $currencies[$currencyId] ?? $this->currencyRepos->find($currencyId);
$currencies[$currencyId] = $currency;
- $amount = $available[$currencyId] ?? '0';
+ $amount = $available[$currencyId]['amount'] ?? '0';
$amountNative = $converter->convert($default, $currency, $start, $amount);
$left = bcadd($amount, $spent);
$leftNative = bcadd($amountNative, $spentNative);