mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Catch and short circuit the case of trying to get the balance of an account
that is so new it hasn't had a currency assigned yet. Fixes #432227. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15988 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
@@ -3255,6 +3255,8 @@ xaccAccountGetXxxBalanceInCurrencyRecursive (const Account *acc,
|
||||
if (!acc) return gnc_numeric_zero ();
|
||||
if (!report_commodity)
|
||||
report_commodity = xaccAccountGetCommodity (acc);
|
||||
if (!report_commodity)
|
||||
return gnc_numeric_zero();
|
||||
|
||||
balance = xaccAccountGetXxxBalanceInCurrency (acc, fn, report_commodity);
|
||||
|
||||
@@ -3280,6 +3282,8 @@ xaccAccountGetXxxBalanceAsOfDateInCurrencyRecursive (
|
||||
g_return_val_if_fail(acc, gnc_numeric_zero());
|
||||
if (!report_commodity)
|
||||
report_commodity = xaccAccountGetCommodity (acc);
|
||||
if (!report_commodity)
|
||||
return gnc_numeric_zero();
|
||||
|
||||
balance = xaccAccountGetXxxBalanceAsOfDateInCurrency(
|
||||
acc, date, fn, report_commodity);
|
||||
|
||||
Reference in New Issue
Block a user