sim-mbim: don't crash if SIM IMSI not provided

E.g. if we have an eSIM without profiles.
This commit is contained in:
Aleksander Morgado
2022-02-01 10:35:56 +01:00
parent 5cf15b3f6f
commit 967d748f04

View File

@@ -276,7 +276,10 @@ load_imsi_finish (MMBaseSim *_self,
g_propagate_error (error, g_error_copy (self->priv->preload_error)); g_propagate_error (error, g_error_copy (self->priv->preload_error));
return NULL; return NULL;
} }
g_assert (self->priv->imsi); if (!self->priv->imsi) {
g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "SIM imsi not available");
return NULL;
}
return g_strdup (self->priv->imsi); return g_strdup (self->priv->imsi);
} }