diff options
Diffstat (limited to 'cli/mmcli-modem-simple.c')
-rw-r--r-- | cli/mmcli-modem-simple.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/cli/mmcli-modem-simple.c b/cli/mmcli-modem-simple.c index 65f615b5..29df8a34 100644 --- a/cli/mmcli-modem-simple.c +++ b/cli/mmcli-modem-simple.c @@ -122,6 +122,16 @@ context_free (Context *ctx) g_free (ctx); } +static void +ensure_modem_simple (void) +{ + if (ctx->modem_simple) + return; + + g_printerr ("error: modem has no Simple capabilities\n"); + exit (EXIT_FAILURE); +} + void mmcli_modem_simple_shutdown (void) { @@ -312,6 +322,8 @@ get_modem_ready (GObject *source, ctx->object = mmcli_get_modem_finish (result, &ctx->manager); ctx->modem_simple = mm_object_get_modem_simple (ctx->object); + ensure_modem_simple (); + /* Request to connect the modem? */ if (connect_str) { GError *error = NULL; @@ -389,6 +401,8 @@ mmcli_modem_simple_run_synchronous (GDBusConnection *connection) &ctx->manager); ctx->modem_simple = mm_object_get_modem_simple (ctx->object); + ensure_modem_simple (); + if (connect_str) g_assert_not_reached (); |