handsfree-audio: Fix crash

For HFP 1.5 devices the driver is always set to NULL.  So if the AG
establishes the SCO connection first, we might crash.
This commit is contained in:
Denis Kenzior 2016-08-23 20:34:52 -05:00
parent 54c9068ff2
commit 80a71f32cd
1 changed files with 1 additions and 1 deletions

View File

@ -203,7 +203,7 @@ static gboolean sco_accept(GIOChannel *io, GIOCondition cond,
send_new_connection(card->path, nsk, card->selected_codec);
close(nsk);
if (card->driver->sco_connected_hint)
if (card->driver && card->driver->sco_connected_hint)
card->driver->sco_connected_hint(card);
return TRUE;