From 96d83392a850b84888661f68cb170dd87fcd3c85 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Wed, 24 Mar 2021 21:47:54 +0100 Subject: [PATCH] iface-modem: avoid lock info update if no interface skeleton available Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/351 --- src/mm-iface-modem.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/mm-iface-modem.c b/src/mm-iface-modem.c index 20580d8f..15d7b634 100644 --- a/src/mm-iface-modem.c +++ b/src/mm-iface-modem.c @@ -3659,9 +3659,6 @@ mm_iface_modem_update_lock_info (MMIfaceModem *self, GTask *task; ctx = g_slice_new0 (UpdateLockInfoContext); - g_object_get (self, - MM_IFACE_MODEM_DBUS_SKELETON, &ctx->skeleton, - NULL); /* If the given lock is known, we will avoid re-asking for it */ ctx->lock = known_lock; @@ -3669,6 +3666,19 @@ mm_iface_modem_update_lock_info (MMIfaceModem *self, task = g_task_new (self, NULL, callback, user_data); g_task_set_task_data (task, ctx, (GDestroyNotify)update_lock_info_context_free); + g_object_get (self, + MM_IFACE_MODEM_DBUS_SKELETON, &ctx->skeleton, + NULL); + + if (!ctx->skeleton) { + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Couldn't get interface skeleton"); + g_object_unref (task); + return; + } + update_lock_info_context_step (task); }