diff --git a/src/engine/Transaction.c b/src/engine/Transaction.c index deb43f9296..95d0cfb10e 100644 --- a/src/engine/Transaction.c +++ b/src/engine/Transaction.c @@ -2351,6 +2351,7 @@ GDate xaccTransGetDatePostedGDate (const Transaction *trans) { GDate result; + g_date_clear (&result, 1); if (trans) { /* Can we look up this value in the kvp slot? If yes, use it @@ -2363,10 +2364,6 @@ xaccTransGetDatePostedGDate (const Transaction *trans) if (! g_date_valid (&result)) result = timespec_to_gdate(xaccTransRetDatePostedTS(trans)); } - else - { - g_date_clear(&result, 1); - } return result; }