[account.cpp] prevent crash in gnc_account_get_currency_or_parent

if the *account argument is NULL, it is not reasonable to have a
g_assert crash. Passing NULL account returns NULL commodity instead.
This commit is contained in:
Christopher Lam 2020-07-09 21:19:27 +08:00
parent a59d91a94b
commit ebb462d06d

View File

@ -3271,7 +3271,7 @@ xaccAccountGetCommodity (const Account *acc)
gnc_commodity * gnc_account_get_currency_or_parent(const Account* account)
{
gnc_commodity * commodity;
g_assert(account);
g_return_val_if_fail (account, NULL);
commodity = xaccAccountGetCommodity (account);
if (gnc_commodity_is_currency(commodity))