From 34b68ec082f86d6099c5db71fcf5593a51a70cfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guido=20G=C3=BCnther?= Date: Wed, 24 Apr 2024 16:44:00 +0200 Subject: [PATCH] mm-origin: Don't crash when Modem has no location services When no locationservice is available the API can return `NULL` without setting an error. Closes: https://gitlab.gnome.org/GNOME/calls/-/issues/641 Part-of: --- plugins/provider/mm/calls-mm-origin.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/provider/mm/calls-mm-origin.c b/plugins/provider/mm/calls-mm-origin.c index 9623ea8..453444a 100644 --- a/plugins/provider/mm/calls-mm-origin.c +++ b/plugins/provider/mm/calls-mm-origin.c @@ -652,7 +652,8 @@ on_modem_location_get_3gpp_finish (GObject *source_object, GAsyncResult *res, gp location_3gpp = mm_modem_location_get_3gpp_finish (location, res, &err); if (!location_3gpp) { - g_warning ("Failed to get 3gpp location service: %s", err->message); + if (err) + g_warning ("Failed to get 3gpp location service: %s", err->message); return; }