diff --git a/glib/gtimer.c b/glib/gtimer.c index 7d21ba822..1e7cad4d7 100644 --- a/glib/gtimer.c +++ b/glib/gtimer.c @@ -294,7 +294,9 @@ G_GNUC_BEGIN_IGNORE_DEPRECATIONS void g_time_val_add (GTimeVal *time_, glong microseconds) { - g_return_if_fail (time_->tv_usec >= 0 && time_->tv_usec < G_USEC_PER_SEC); + g_return_if_fail (time_ != NULL && + time_->tv_usec >= 0 && + time_->tv_usec < G_USEC_PER_SEC); if (microseconds >= 0) { @@ -603,7 +605,9 @@ g_time_val_to_iso8601 (GTimeVal *time_) #endif time_t secs; - g_return_val_if_fail (time_->tv_usec >= 0 && time_->tv_usec < G_USEC_PER_SEC, NULL); + g_return_val_if_fail (time_ != NULL && + time_->tv_usec >= 0 && + time_->tv_usec < G_USEC_PER_SEC, NULL); secs = time_->tv_sec; #ifdef _WIN32