diff options
author | José Alburquerque <jaalburqu@svn.gnome.org> | 2009-06-22 12:12:53 -0400 |
---|---|---|
committer | José Alburquerque <jaalburqu@svn.gnome.org> | 2009-06-22 12:12:53 -0400 |
commit | 5bd4921c2020737e0399712630e23fd85039ef62 (patch) | |
tree | 5cd5451aef28750defa8a19e46c67536eed78915 /glib | |
parent | e963653133436d04cc4b45a312200cc795aa824f (diff) | |
download | glibmm-5bd4921c2020737e0399712630e23fd85039ef62.tar.gz |
Check for invalid date in Glib::Date copy constructor.
Diffstat (limited to 'glib')
-rw-r--r-- | glib/src/date.ccg | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/glib/src/date.ccg b/glib/src/date.ccg index fff0a1e1..3bd6697d 100644 --- a/glib/src/date.ccg +++ b/glib/src/date.ccg @@ -59,12 +59,13 @@ Date::Date(const GDate& castitem) Date::Date(const Date& other) { g_date_clear(&gobject_, 1); - g_date_set_julian(&gobject_, other.get_julian()); + if (g_date_valid(&other.gobject_)) + g_date_set_julian(&gobject_, other.get_julian()); } Date& Date::operator=(const Date& other) { - if (&other != this) + if (&other != this && g_date_valid(&other.gobject_)) g_date_set_julian(&gobject_, other.get_julian()); return *this; |