diff --git a/coreapi/presence.c b/coreapi/presence.c index 12fb8f834..30d986c2f 100644 --- a/coreapi/presence.c +++ b/coreapi/presence.c @@ -1229,6 +1229,7 @@ static int process_pidf_xml_presence_service_notes(xmlparsing_context_t *xml_ctx static int process_pidf_xml_presence_services(xmlparsing_context_t *xml_ctx, LinphonePresenceModel *model) { char xpath_str[MAX_XPATH_LENGTH]; xmlXPathObjectPtr service_object; + xmlXPathObjectPtr pidfonline_object; LinphonePresenceService *service; const char *basic_status_str; const char *service_id_str; @@ -1256,7 +1257,9 @@ static int process_pidf_xml_presence_services(xmlparsing_context_t *xml_ctx, Lin } snprintf(xpath_str, sizeof(xpath_str), "%s[%i]/pidf:status/pidfonline:online", service_prefix, i); - if (linphone_get_xml_xpath_object_for_node_list(xml_ctx, xpath_str) != NULL) { + if ((pidfonline_object = linphone_get_xml_xpath_object_for_node_list(xml_ctx, xpath_str)) != NULL + && pidfonline_object->nodesetval + && pidfonline_object->nodesetval->nodeNr >0) { model->is_online = TRUE; }