From 85f702d540c998b91f5004b9c9629faaacfc37bd Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Fri, 8 Apr 2016 16:37:55 -0500 Subject: in timezone-timedated, check for error!=nullptr before passing it to g_error_matches() --- src/timezone-timedated.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/timezone-timedated.cpp b/src/timezone-timedated.cpp index 9254612..e123531 100644 --- a/src/timezone-timedated.cpp +++ b/src/timezone-timedated.cpp @@ -171,12 +171,12 @@ private: { GError* error {}; GVariant* v = g_dbus_connection_call_finish(G_DBUS_CONNECTION(connection), res, &error); - if (v == nullptr) + if (error != nullptr) { if (!g_error_matches(error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) g_warning("%s Couldn't get timezone: %s", G_STRLOC, error->message); } - else + else if (v != nullptr) { GVariant* tzv {}; g_variant_get(v, "(v)", &tzv); -- cgit v1.2.3