46 lines
1.6 KiB
Diff
46 lines
1.6 KiB
Diff
From dad011062bb9f6bfa6751c43964f718e676014f3 Mon Sep 17 00:00:00 2001
|
|
From: Lubomir Rintel <lkundrak@v3.sk>
|
|
Date: Wed, 8 Jun 2022 13:24:49 +0200
|
|
Subject: [PATCH] wwan: do not insist SIM ID being present
|
|
|
|
It is perfectly possible for mm_sim_dup_identifier() to return NULL if
|
|
the SIM ID wasn't provided by the modem for any reason, leading to an
|
|
assertion failure:
|
|
|
|
(gnome-control-center:910641): cc-wwan-data-CRITICAL **: 12:43:51.573:
|
|
cc_wwan_data_set_default_apn: assertion 'self->sim_id != NULL' failed
|
|
|
|
Handle the NULL SIM ID gracefully.
|
|
---
|
|
panels/wwan/cc-wwan-data.c | 7 ++++---
|
|
1 file changed, 4 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/panels/wwan/cc-wwan-data.c b/panels/wwan/cc-wwan-data.c
|
|
index ca54c731fd..3bb7ad78ff 100644
|
|
--- a/panels/wwan/cc-wwan-data.c
|
|
+++ b/panels/wwan/cc-wwan-data.c
|
|
@@ -1024,7 +1024,6 @@ cc_wwan_data_set_default_apn (CcWwanData *self,
|
|
|
|
g_return_val_if_fail (CC_IS_WWAN_DATA (self), FALSE);
|
|
g_return_val_if_fail (CC_IS_WWAN_DATA_APN (apn), FALSE);
|
|
- g_return_val_if_fail (self->sim_id != NULL, FALSE);
|
|
|
|
if (self->default_apn == apn)
|
|
return FALSE;
|
|
@@ -1040,8 +1039,10 @@ cc_wwan_data_set_default_apn (CcWwanData *self,
|
|
self->default_apn = apn;
|
|
connection = wwan_data_get_nm_connection (apn);
|
|
setting = NM_SETTING (nm_connection_get_setting_gsm (connection));
|
|
- g_object_set (G_OBJECT (setting),
|
|
- NM_SETTING_GSM_SIM_ID, self->sim_id, NULL);
|
|
+
|
|
+ if (self->sim_id)
|
|
+ g_object_set (G_OBJECT (setting),
|
|
+ NM_SETTING_GSM_SIM_ID, self->sim_id, NULL);
|
|
|
|
return TRUE;
|
|
}
|
|
--
|
|
GitLab
|
|
|