From af89e63c35f38f1fc920614e132c14203ccc9f24 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Wed, 14 Jun 2023 13:48:06 +0000 Subject: iface-modem: ignore sim swap check if not implemented Explicitly return TRUE to indicate success because otherwise the caller will expect a valid GError set. --- src/mm-iface-modem.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/mm-iface-modem.c b/src/mm-iface-modem.c index 12f26223..b3d46ee0 100644 --- a/src/mm-iface-modem.c +++ b/src/mm-iface-modem.c @@ -197,20 +197,21 @@ mm_iface_modem_check_for_sim_swap (MMIfaceModem *self, } } - if (MM_IFACE_MODEM_GET_INTERFACE (self)->check_for_sim_swap && - MM_IFACE_MODEM_GET_INTERFACE (self)->check_for_sim_swap_finish) { - mm_obj_info (self, "start checking for SIM swap in slot %u", slot_index); - MM_IFACE_MODEM_GET_INTERFACE (self)->check_for_sim_swap ( - self, - iccid, - imsi, - (GAsyncReadyCallback)explicit_check_for_sim_swap_ready, - task); + if (!MM_IFACE_MODEM_GET_INTERFACE (self)->check_for_sim_swap || + !MM_IFACE_MODEM_GET_INTERFACE (self)->check_for_sim_swap_finish) { + mm_obj_info (self, "checking for SIM swap ignored: not implemented"); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } - g_task_return_boolean (task, FALSE); - g_object_unref (task); + mm_obj_info (self, "start checking for SIM swap in slot %u", slot_index); + MM_IFACE_MODEM_GET_INTERFACE (self)->check_for_sim_swap ( + self, + iccid, + imsi, + (GAsyncReadyCallback)explicit_check_for_sim_swap_ready, + task); } /*****************************************************************************/ -- cgit v1.2.3-70-g09d2