mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Bug 685329 - Crashes on non-existent date
Log an error instead of crashing. The transaction will be imported with today’s date.
This commit is contained in:
parent
78b41f7ac1
commit
54beffd936
@ -1973,9 +1973,15 @@ xaccTransSetDate (Transaction *trans, int day, int mon, int year)
|
||||
GDate *date;
|
||||
if (!trans) return;
|
||||
date = g_date_new_dmy(day, mon, year);
|
||||
g_assert(g_date_valid(date));
|
||||
if (!g_date_valid(date))
|
||||
{
|
||||
PWARN("Attempted to set invalid date %d-%d-%d; set today's date instead.",
|
||||
year, mon, day);
|
||||
g_free(date);
|
||||
date = gnc_g_date_new_today();
|
||||
}
|
||||
xaccTransSetDatePostedGDate(trans, *date);
|
||||
g_date_free(date);
|
||||
g_free(date);
|
||||
}
|
||||
|
||||
void
|
||||
|
Loading…
Reference in New Issue
Block a user