diff options
-rw-r--r-- | plugins/huawei.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/huawei.c b/plugins/huawei.c index 4051a934..b3844e97 100644 --- a/plugins/huawei.c +++ b/plugins/huawei.c @@ -681,8 +681,9 @@ static void huawei_post_online(struct ofono_modem *modem) ofono_ussd_create(modem, OFONO_VENDOR_QUALCOMM_MSM, "atmodem", data->pcui); - if (data->sim_state == HUAWEI_SIM_STATE_VALID || - data->sim_state == HUAWEI_SIM_STATE_INVALID_CS) { + if ((data->sim_state == HUAWEI_SIM_STATE_VALID || + data->sim_state == HUAWEI_SIM_STATE_INVALID_CS) && + data->modem != NULL) { data->gprs = ofono_gprs_create(modem, OFONO_VENDOR_HUAWEI, "atmodem", data->pcui); |