network.c: notify_status_watches: check for NULL

In rare cases when ofono_netreg_status_notify() is called before
ofono_netreg_register() netreg->status_watches is NULL.
This commit is contained in:
Alexander Couzens 2017-09-11 02:25:42 +02:00 committed by Denis Kenzior
parent 4590c695e0
commit e98f683309
1 changed files with 3 additions and 0 deletions

View File

@ -1186,6 +1186,9 @@ static void notify_status_watches(struct ofono_netreg *netreg)
const char *mcc = NULL;
const char *mnc = NULL;
if (netreg->status_watches == NULL)
return;
if (netreg->current_operator) {
mcc = netreg->current_operator->mcc;
mnc = netreg->current_operator->mnc;