From f3c1b56e73248ac3025cc1c75e8b660514b237ff Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Fri, 18 Mar 2016 12:30:07 +0000 Subject: [PATCH] trivial: Fix a potential crash spotted with clang --- libfwupd/fwupd-client.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libfwupd/fwupd-client.c b/libfwupd/fwupd-client.c index 718641172..023442002 100644 --- a/libfwupd/fwupd-client.c +++ b/libfwupd/fwupd-client.c @@ -235,7 +235,8 @@ fwupd_client_get_devices (FwupdClient *client, GCancellable *cancellable, GError cancellable, error); if (val == NULL) { - g_dbus_error_strip_remote_error (*error); + if (error != NULL) + g_dbus_error_strip_remote_error (*error); return NULL; } return fwupd_client_parse_results_from_data (val); @@ -276,7 +277,8 @@ fwupd_client_get_updates (FwupdClient *client, GCancellable *cancellable, GError cancellable, error); if (val == NULL) { - g_dbus_error_strip_remote_error (*error); + if (error != NULL) + g_dbus_error_strip_remote_error (*error); return NULL; } return fwupd_client_parse_results_from_data (val);