From 92e41b7509abe96b513e3b95295e77ad34b675e3 Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Thu, 17 Nov 2011 04:48:07 +0000 Subject: [PATCH] Avoid a crash when the modem plug-in could not be loaded --- src/phone.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/phone.c b/src/phone.c index c9fc034..d666653 100644 --- a/src/phone.c +++ b/src/phone.c @@ -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;