broadband-modem: fix assertion during capabilities checking (bgo #698845)
If no capabilities could be determined from the modem's responses, result would be NULL but no error would be set, since the modem didn't time out or have some other critical error, it simply didn't report any recognized capabilities. Ensure that an error is reported in this case. https://bugzilla.gnome.org/show_bug.cgi?id=698845
This commit is contained in:
@@ -502,7 +502,15 @@ capabilities_sequence_ready (MMBaseModem *self,
|
|||||||
|
|
||||||
result = mm_base_modem_at_sequence_finish (self, res, NULL, &error);
|
result = mm_base_modem_at_sequence_finish (self, res, NULL, &error);
|
||||||
if (!result) {
|
if (!result) {
|
||||||
g_simple_async_result_take_error (ctx->result, error);
|
if (error)
|
||||||
|
g_simple_async_result_take_error (ctx->result, error);
|
||||||
|
else {
|
||||||
|
g_simple_async_result_set_error (ctx->result,
|
||||||
|
MM_CORE_ERROR,
|
||||||
|
MM_CORE_ERROR_FAILED,
|
||||||
|
"%s",
|
||||||
|
"Failed to determine modem capabilities.");
|
||||||
|
}
|
||||||
load_capabilities_context_complete_and_free (ctx);
|
load_capabilities_context_complete_and_free (ctx);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user