From 929648387338015e5039b4061ff3cbc21fd2d439 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Fri, 2 Jun 2017 15:52:17 +0200 Subject: [PATCH] fix pidfonline checking --- coreapi/presence.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; }