mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-26 05:56:14 +01:00
gdatetime: add NULL guard in g_date_time_new_now()
Add a missing g_return_() check in g_date_time_new_now(). A clear warning is better than a NULL pointer dereference.
This commit is contained in:
parent
2b8b866bae
commit
574a2ecfa9
@ -959,6 +959,8 @@ g_date_time_new_now (GTimeZone *tz)
|
|||||||
{
|
{
|
||||||
gint64 now_us;
|
gint64 now_us;
|
||||||
|
|
||||||
|
g_return_val_if_fail (tz != NULL, NULL);
|
||||||
|
|
||||||
now_us = g_get_real_time ();
|
now_us = g_get_real_time ();
|
||||||
|
|
||||||
return g_date_time_new_from_unix (tz, now_us);
|
return g_date_time_new_from_unix (tz, now_us);
|
||||||
|
Loading…
Reference in New Issue
Block a user