diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2012-10-15 13:35:15 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2012-10-15 13:35:15 +0200 |
commit | ae26762d110855ab1294c6afad1dc153dd3532c7 (patch) | |
tree | 29a94417b545d2964b362714b9bef1dc97812617 | |
parent | 4f55511680c04c89f8288cdf07fc7ad2c5c5b096 (diff) |
cli: avoid segfault when revision info is not given
-rw-r--r-- | cli/mmcli-modem.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/cli/mmcli-modem.c b/cli/mmcli-modem.c index 26519c0f..981421b6 100644 --- a/cli/mmcli-modem.c +++ b/cli/mmcli-modem.c @@ -289,8 +289,11 @@ print_modem_info (void) drivers_string = NULL; /* Rework possible multiline strings */ - prefixed_revision = mmcli_prefix_newlines (" | ", - mm_modem_get_revision (ctx->modem)); + if (mm_modem_get_revision (ctx->modem)) + prefixed_revision = mmcli_prefix_newlines (" | ", + mm_modem_get_revision (ctx->modem)); + else + prefixed_revision = NULL; /* Get signal quality info */ signal_quality = mm_modem_get_signal_quality (ctx->modem, &signal_quality_recent); |