summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <slomo@coaxion.net>2022-10-10 06:52:56 +0000
committerSebastian Dröge <slomo@coaxion.net>2022-10-10 06:52:56 +0000
commit2f284193a7c6ba08d6a3bc37fc7138696d00d07c (patch)
treea9df79a9e350c56edd09f0abedb83ae8df9bd468
parent2b8b866bae578d66e46caf96bf617a75a2fd8fa6 (diff)
parent574a2ecfa9472410cf382a4fb545fe41fe0d5128 (diff)
downloadglib-2f284193a7c6ba08d6a3bc37fc7138696d00d07c.tar.gz
Merge branch 'date-time-new-now' into 'main'
gdatetime: add NULL guard in g_date_time_new_now() See merge request GNOME/glib!2938
-rw-r--r--glib/gdatetime.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/glib/gdatetime.c b/glib/gdatetime.c
index db746564d..a9c472e55 100644
--- a/glib/gdatetime.c
+++ b/glib/gdatetime.c
@@ -959,6 +959,8 @@ g_date_time_new_now (GTimeZone *tz)
{
gint64 now_us;
+ g_return_val_if_fail (tz != NULL, NULL);
+
now_us = g_get_real_time ();
return g_date_time_new_from_unix (tz, now_us);