diff options
Diffstat (limited to 'libmm-glib/mm-common-helpers.c')
-rw-r--r-- | libmm-glib/mm-common-helpers.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/libmm-glib/mm-common-helpers.c b/libmm-glib/mm-common-helpers.c index b7883b26..085177b7 100644 --- a/libmm-glib/mm-common-helpers.c +++ b/libmm-glib/mm-common-helpers.c @@ -1769,7 +1769,8 @@ mm_new_iso8601_time (guint year, guint minute, guint second, gboolean have_offset, - gint offset_minutes) + gint offset_minutes, + GError **error) { g_autoptr(GDateTime) dt = NULL; @@ -1781,6 +1782,14 @@ mm_new_iso8601_time (guint year, } else dt = g_date_time_new_utc (year, month, day, hour, minute, second); + if (dt == NULL) { + g_set_error (error, + MM_CORE_ERROR, + MM_CORE_ERROR_INVALID_ARGS, + "Invalid input for date: got year:%u, month:%u, day:%u, hour:%u, minute:%u, second:%u", + year, month, day, hour, minute, second); + return NULL; + } return date_time_format_iso8601 (dt); } |