From 2b20f9100d30a5ab0c3c1e4754cf531c9e7a69ee Mon Sep 17 00:00:00 2001 From: Linas Vepstas Date: Sat, 28 Mar 1998 04:03:23 +0000 Subject: [PATCH] add a side effect (yuck) why am i doing this? git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@740 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/engine/Group.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/engine/Group.c b/src/engine/Group.c index 69baca579b..49520385e2 100644 --- a/src/engine/Group.c +++ b/src/engine/Group.c @@ -396,7 +396,6 @@ xaccInsertSubAccount( Account *adult, Account *child ) int retval; if (NULL == adult) return -1; - if (NULL == child) return -1; /* if a container for the children doesn't yet exist, add it */ if (NULL == adult->children) { @@ -406,6 +405,9 @@ xaccInsertSubAccount( Account *adult, Account *child ) /* set back-pointer to parent */ adult->children->parent = adult; + /* allow side-effect of creating a child-less account group */ + if (NULL == child) return -1; + retval = insertAccount (adult->children, child); return retval; }