mirror of
https://gitlab.gnome.org/GNOME/calls.git
synced 2024-12-04 20:07:36 +00:00
mm-origin: Handle missing SIM case more gracefully
This avoids warnings like gnome-calls[57992]: mm_sim_get_imsi: assertion 'MM_IS_SIM (self)' failed gnome-calls[57992]: mm_sim_dup_emergency_numbers: assertion 'MM_IS_SIM (self)' failed in the logs Part-of: <https://gitlab.gnome.org/GNOME/calls/-/merge_requests/735>
This commit is contained in:
parent
f9eaf03c19
commit
93e0c72d9f
1 changed files with 6 additions and 1 deletions
|
@ -882,13 +882,18 @@ get_sim_ready_cb (MMModem *modem,
|
|||
GAsyncResult *res,
|
||||
gpointer user_data)
|
||||
{
|
||||
g_autoptr (GError) err = NULL;
|
||||
g_autoptr (CallsMMOrigin) self = NULL;
|
||||
const char *code;
|
||||
|
||||
g_assert (CALLS_IS_MM_ORIGIN (user_data));
|
||||
self = CALLS_MM_ORIGIN (user_data);
|
||||
|
||||
self->sim = mm_modem_get_sim_finish (modem, res, NULL);
|
||||
self->sim = mm_modem_get_sim_finish (modem, res, &err);
|
||||
if (!self->sim) {
|
||||
g_warning ("Couldn't get sim: %s", err->message);
|
||||
return;
|
||||
}
|
||||
|
||||
code = get_country_iso_for_mcc (mm_sim_get_imsi (self->sim));
|
||||
if (code && g_strcmp0 (self->country_code, code)) {
|
||||
|
|
Loading…
Reference in a new issue