sim: check existence of imsi-code
authorPetteri Tikander <petteri.tikander@ixonos.com>
Thu, 21 Oct 2010 14:58:13 +0000 (17:58 +0300)
committerDenis Kenzior <denkenz@gmail.com>
Fri, 22 Oct 2010 16:23:08 +0000 (11:23 -0500)
For instance: when handling sim_get_properties
in PRE_SIM-state imsi is not received/stored.

src/sim.c

index e5be8b6..1d294dc 100644 (file)
--- a/src/sim.c
+++ b/src/sim.c
@@ -314,7 +314,7 @@ static DBusMessage *sim_get_properties(DBusConnection *conn,
        ofono_dbus_dict_append(&dict, "FixedDialing", DBUS_TYPE_BOOLEAN,
                                &sim->fixed_dialing);
 
-       if (sim->mnc_length) {
+       if (sim->mnc_length && sim->imsi) {
                char mcc[OFONO_MAX_MCC_LENGTH + 1];
                char mnc[OFONO_MAX_MNC_LENGTH + 1];
                const char *str;