aboutsummaryrefslogtreecommitdiff
path: root/src/timezone-timedated.cpp
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2016-04-08 16:37:55 -0500
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2021-08-29 14:37:39 +0200
commit8b30701b2052c0ae30d585248bce41b6d6fb3985 (patch)
tree1aeb016d9c96ef8c071f5c5af06bddb5af754aad /src/timezone-timedated.cpp
parentfc5d3e97e21ee13c24b3fc78cddc2d8db43d58bc (diff)
downloadayatana-indicator-datetime-8b30701b2052c0ae30d585248bce41b6d6fb3985.tar.gz
ayatana-indicator-datetime-8b30701b2052c0ae30d585248bce41b6d6fb3985.tar.bz2
ayatana-indicator-datetime-8b30701b2052c0ae30d585248bce41b6d6fb3985.zip
in timezone-timedated, check for error!=nullptr before passing it to g_error_matches()
Diffstat (limited to 'src/timezone-timedated.cpp')
-rw-r--r--src/timezone-timedated.cpp4
1 files changed, 2 insertions, 2 deletions
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);