mirror of
https://github.com/Gnucash/gnucash.git
synced 2026-09-03 20:53:02 -05:00
Allow SchedXaction to safely handle having g_object_property_set called on
end_date and last_date with invalid GDates. This happens routinely when those values are empty and are restored from SQL. Thanks to all warnings being fatal when testing, this caused the dbi tests to fail. [BP] git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22465 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
@@ -132,10 +132,16 @@ gnc_schedxaction_get_property (GObject *object,
|
||||
g_value_set_boxed(value, &sx->start_date);
|
||||
break;
|
||||
case PROP_END_DATE:
|
||||
g_value_set_boxed(value, &sx->end_date);
|
||||
/* g_value_set_boxed raises a critical error if sx->end_date
|
||||
* is invalid */
|
||||
if (g_date_valid (&sx->end_date))
|
||||
g_value_set_boxed(value, &sx->end_date);
|
||||
break;
|
||||
case PROP_LAST_OCCURANCE_DATE:
|
||||
g_value_set_boxed(value, &sx->last_date);
|
||||
/* g_value_set_boxed raises a critical error if sx->last_date
|
||||
* is invalid */
|
||||
if (g_date_valid (&sx->last_date))
|
||||
g_value_set_boxed(value, &sx->last_date);
|
||||
break;
|
||||
case PROP_INSTANCE_COUNT:
|
||||
g_value_set_int(value, sx->instance_num);
|
||||
|
||||
Reference in New Issue
Block a user