Skip to content

Firefly III: a personal finances manager

Add message.

James Cole31c1e28c7608
diff --git a/app/Support/Amount.php b/app/Support/Amount.php
index 5bb7815df0..ecdcd3c944 100644
--- a/app/Support/Amount.php
+++ b/app/Support/Amount.php
@@ -333,6 +333,10 @@ class Amount
public function getTransactionCurrencyById(int $currencyId): TransactionCurrency
{
+ if(0 === $currencyId) {
+ Log::debug('Could never find a currency with ID zero. Throw error.');
+ throw new FireflyException('Could never find a currency with ID zero. Throw error.');
+ }
$instance = PreferencesSingleton::getInstance();
$key = sprintf('transaction_currency_%d', $currencyId);