From e1d77fb1d101fc20236b7b0a02747b64bfccbe4f Mon Sep 17 00:00:00 2001 From: David Hampton Date: Sat, 21 Apr 2007 18:30:20 +0000 Subject: [PATCH] Relax the check on whether xaccAccountGetCommodity is called with a valid commodity. This function is called from many places without testing to see if the account is non-NULL. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15953 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/engine/Account.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/engine/Account.c b/src/engine/Account.c index 96483ad1fb..d9915ddf1e 100644 --- a/src/engine/Account.c +++ b/src/engine/Account.c @@ -2849,7 +2849,8 @@ DxaccAccountGetCurrency (const Account *acc) gnc_commodity * xaccAccountGetCommodity (const Account *acc) { - g_return_val_if_fail(GNC_IS_ACCOUNT(acc), NULL); + if (!GNC_IS_ACCOUNT(acc)) + return NULL; return GET_PRIVATE(acc)->commodity; }