mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Bug 743807 Stops critical error messages.
As you type a date into the calendar widget it tries to make a GDate with the current year and month, if you are typing 31/ in February you get a critical error in the trace file. This patch adds a test for a valid date before proceeding.
This commit is contained in:
parent
068fc3567d
commit
7bddcd95b0
@ -254,6 +254,10 @@ gnc_handle_date_accelerator (GdkEventKey *event,
|
||||
if ((tm->tm_mday <= 0) || (tm->tm_mon == -1) || (tm->tm_year == -1))
|
||||
return FALSE;
|
||||
|
||||
// Make sure we have a valid date before we proceed
|
||||
if (!g_date_valid_dmy (tm->tm_mday, tm->tm_mon + 1, tm->tm_year + 1900))
|
||||
return FALSE;
|
||||
|
||||
g_date_set_dmy (&gdate,
|
||||
tm->tm_mday,
|
||||
tm->tm_mon + 1,
|
||||
|
Loading…
Reference in New Issue
Block a user