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:
John Ralls
2012-10-27 23:30:56 +00:00
parent ab0d45a034
commit d9fb4d3511
+8 -2
View File
@@ -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);