cli: avoid segfault when revision info is not given

This commit is contained in:
Aleksander Morgado
2012-10-15 13:35:15 +02:00
parent 4f55511680
commit ae26762d11

View File

@@ -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);