diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2012-10-22 12:27:55 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2012-10-22 12:27:55 +0200 |
commit | c5f3198a9fdcd22a342be496b7ba6751ea1b53d2 (patch) | |
tree | 35f5685b66f6290885233e6a67259265b2132805 | |
parent | 10a0ed12c461242ca3dbf6f9192907d320b561f7 (diff) |
device: only export modem if it is available
-rw-r--r-- | src/mm-device.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/mm-device.c b/src/mm-device.c index c5491008..c28d0b5a 100644 --- a/src/mm-device.c +++ b/src/mm-device.c @@ -435,8 +435,14 @@ modem_valid (MMBaseModem *modem, /* Modem no longer valid */ mm_device_remove_modem (self); } else { - /* Modem now valid, export it */ - export_modem (self); + /* Modem now valid, export it, but only if we really have it around. + * It may happen that the initialization sequence fails because the + * modem gets disconnected, and in that case we don't really need + * to export it */ + if (self->priv->modem) + export_modem (self); + else + mm_dbg ("Not exporting modem; no longer available"); } } |