aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2021-03-24 21:47:54 +0100
committerAleksander Morgado <aleksander@aleksander.es>2021-03-24 21:53:45 +0100
commit96d83392a850b84888661f68cb170dd87fcd3c85 (patch)
tree32ded1edc21307b1e36852b56915eb3b8128a87e
parent342b7119c3337f1baa4648dac473a7274ca084f0 (diff)
iface-modem: avoid lock info update if no interface skeleton available
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/351
-rw-r--r--src/mm-iface-modem.c16
1 files 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);
}