aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2023-03-27 12:15:18 +0200
committerAleksander Morgado <aleksandermj@chromium.org>2023-03-27 12:28:15 +0000
commita9ae995323b5c89ba06db69ddcdf7cda2f502dba (patch)
treefae82ef9128b53e8c3c7b5bf1bcbddb04c342688 /src
parent70c8fe1fef62555618b52b06f1929574563b3e61 (diff)
iface-modem-3gpp: avoid to connect signal on NULL SIM object
Happens when we boot without a SIM card inserted: ModemManager[12065]: <dbg> [1679912011.887410] [ttyACM2/at] --> 'AT+CLCK="PC",2<CR>' ModemManager[12065]: <dbg> [1679912011.905401] [ttyACM2/at] <-- '<CR><LF>+CLCK: 0<CR><LF><CR><LF>OK<CR><LF>' (ModemManager:12065): GLib-GObject-CRITICAL **: 12:13:31.905: invalid (NULL) pointer instance
Diffstat (limited to 'src')
-rw-r--r--src/mm-iface-modem-3gpp.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/mm-iface-modem-3gpp.c b/src/mm-iface-modem-3gpp.c
index 50246791..0399d1a5 100644
--- a/src/mm-iface-modem-3gpp.c
+++ b/src/mm-iface-modem-3gpp.c
@@ -3188,10 +3188,12 @@ load_enabled_facility_locks_ready (MMIfaceModem3gpp *self,
* which notifies about such update. There is no need to ref self as the
* SIM itself is an object which exists as long as self exists. */
g_object_get (self, MM_IFACE_MODEM_SIM, &sim, NULL);
- g_signal_connect (sim,
- MM_BASE_SIM_PIN_LOCK_ENABLED,
- G_CALLBACK (sim_pin_lock_enabled_cb),
- ctx->skeleton);
+
+ if (sim)
+ g_signal_connect (sim,
+ MM_BASE_SIM_PIN_LOCK_ENABLED,
+ G_CALLBACK (sim_pin_lock_enabled_cb),
+ ctx->skeleton);
}
/* Go on to next step */