mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-04 08:23:38 +02:00
gcancellable: add back lost NULL check in g_cancellable_cancel()
Commit f975858e86
removed the NULL check in g_cancellable_cancel() by
accident which makes it crash when called with NULL.
Add the check back and add a test so this doesn't happen again.
Fixes #1710
This commit is contained in:
@@ -484,7 +484,7 @@ g_cancellable_cancel (GCancellable *cancellable)
|
||||
{
|
||||
GCancellablePrivate *priv;
|
||||
|
||||
if (g_cancellable_is_cancelled (cancellable))
|
||||
if (cancellable == NULL || g_cancellable_is_cancelled (cancellable))
|
||||
return;
|
||||
|
||||
priv = cancellable->priv;
|
||||
|
Reference in New Issue
Block a user