summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2021-09-08 10:26:04 +0200
committerAleksander Morgado <aleksander@aleksander.es>2021-09-08 10:26:04 +0200
commit34e671f41cf9bb964b92ca555c71bcaa15c90893 (patch)
treebf2d54a0a5d4cfda1784eaaac93fb40c3b2894f2
parentf2901446e0ef1f82c8ae27edc69d681a2a542957 (diff)
downloadModemManager-34e671f41cf9bb964b92ca555c71bcaa15c90893.tar.gz
broadband-modem-qmi: don't error out on empty call list
Only error out if the required TLVs are missing.
-rw-r--r--src/mm-broadband-modem-qmi.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/mm-broadband-modem-qmi.c b/src/mm-broadband-modem-qmi.c
index e61e487a7..ea21a576d 100644
--- a/src/mm-broadband-modem-qmi.c
+++ b/src/mm-broadband-modem-qmi.c
@@ -9240,15 +9240,20 @@ process_get_all_call_info (QmiClientVoice *client,
guint i;
guint j;
- qmi_message_voice_get_all_call_info_output_get_remote_party_number (output, &qmi_remote_party_number_list, NULL);
- qmi_message_voice_get_all_call_info_output_get_call_information (output, &qmi_call_information_list, NULL);
-
- if (!qmi_remote_party_number_list || !qmi_call_information_list) {
+ /* If TLVs missing, report an error */
+ if (!qmi_message_voice_get_all_call_info_output_get_remote_party_number (output, &qmi_remote_party_number_list, NULL) ||
+ !qmi_message_voice_get_all_call_info_output_get_call_information (output, &qmi_call_information_list, NULL)) {
g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_INVALID_ARGS,
"Remote party number or call information not available");
return FALSE;
}
+ /* If there are no ongoing calls, the lists will be NULL */
+ if (!qmi_remote_party_number_list || !qmi_call_information_list) {
+ *out_call_info_list = NULL;
+ return TRUE;
+ }
+
for (i = 0; i < qmi_call_information_list->len; i++) {
QmiMessageVoiceGetAllCallInfoOutputCallInformationCall qmi_call_information;