From 14da30d2bfef0a0802780885f7b9480ecc3e5fa3 Mon Sep 17 00:00:00 2001 From: David Hampton Date: Sun, 22 Apr 2007 18:30:48 +0000 Subject: [PATCH] Allow NULL pointers when calling xaccAccountGetFullName. Fixes #432314. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15987 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/engine/Account.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/engine/Account.c b/src/engine/Account.c index e40c9e11f5..03cf53e6dd 100644 --- a/src/engine/Account.c +++ b/src/engine/Account.c @@ -2774,8 +2774,14 @@ xaccAccountGetFullName(const Account *account) gchar **names; int level; + /* So much for hardening the API. Too many callers to this function don't + * bother to check if they have a non-NULL pointer before calling. */ + if (NULL == account) + return g_strdup(""); + /* errors */ g_return_val_if_fail(GNC_IS_ACCOUNT(account), g_strdup("")); + /* optimizations */ priv = GET_PRIVATE(account); if (!priv->parent)