Avoid a crash when the modem plug-in could not be loaded

This commit is contained in:
Pierre Pronchery 2011-11-17 04:48:07 +00:00
parent 1078075707
commit 92e41b7509

View File

@ -907,7 +907,9 @@ int phone_event(Phone * phone, PhoneEvent * event)
PHONE_EVENT_TYPE_STARTED);
break;
case PHONE_EVENT_TYPE_STOPPING:
if(ret == 0 && (ret = modem_stop(phone->modem)) == 0)
if(ret == 0 && phone->modem != NULL
&& (ret = modem_stop(phone->modem))
== 0)
phone_event_type(phone,
PHONE_EVENT_TYPE_STOPPED);
break;