simple: don't try to enable the "unknown" band

If the band isn't actually given, don't try to enable it.
This commit is contained in:
Dan Williams
2012-10-19 19:32:28 -05:00
parent 79fdddccbf
commit 7f105dc386
+11 -9
View File
@@ -599,16 +599,18 @@ connection_step (ConnectionContext *ctx)
GArray *array;
guint i;
array = g_array_sized_new (FALSE, FALSE, sizeof (MMModemBand), n_bands);
for (i = 0; i < n_bands; i++)
g_array_insert_val (array, i, bands[i]);
if (bands && *bands) {
array = g_array_sized_new (FALSE, FALSE, sizeof (MMModemBand), n_bands);
for (i = 0; i < n_bands; i++)
g_array_insert_val (array, i, bands[i]);
mm_iface_modem_set_bands (MM_IFACE_MODEM (ctx->self),
array,
(GAsyncReadyCallback)set_bands_ready,
ctx);
g_array_unref (array);
return;
mm_iface_modem_set_bands (MM_IFACE_MODEM (ctx->self),
array,
(GAsyncReadyCallback)set_bands_ready,
ctx);
g_array_unref (array);
return;
}
}
/* Fall down to next step */