/soc/2015/jgeboski/facebook: 6a0a79182ebc: facebook: fixed delet...

James Geboski <[email protected]>
Newsgroups gmane.comp.gnome.gaim.cvs
Message-ID <[email protected]>
Changeset: 6a0a79182ebc0eaeb127572bc1fc90c948aad7ee
Author:	 James Geboski <[email protected]>
Date:	 2015-08-26 19:48 -0400
Branch:	 facebook
URL: https://hg.pidgin.im/soc/2015/jgeboski/facebook/rev/6a0a79182ebc

Description:

facebook: fixed deleted XMAs being fatal

diffstat:

 libpurple/protocols/facebook/api.c |  12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diffs (34 lines):

diff --git a/libpurple/protocols/facebook/api.c b/libpurple/protocols/facebook/api.c
--- a/libpurple/protocols/facebook/api.c
+++ b/libpurple/protocols/facebook/api.c
@@ -1265,21 +1265,27 @@ fb_api_xma_parse(FbApi *api, const gchar
 	GError *err = NULL;
 
 	values = fb_json_values_new(root);
-	fb_json_values_add(values, FB_JSON_TYPE_STR, TRUE,
+	fb_json_values_add(values, FB_JSON_TYPE_STR, FALSE,
 	                   "$.story_attachment.target.__type__.name");
-	fb_json_values_add(values, FB_JSON_TYPE_STR, TRUE,
+	fb_json_values_add(values, FB_JSON_TYPE_STR, FALSE,
 	                   "$.story_attachment.url");
 	fb_json_values_update(values, &err);
 
 	if (G_UNLIKELY(err != NULL)) {
 		g_propagate_error(error, err);
 		g_object_unref(values);
-		return FALSE;
+		return NULL;
 	}
 
 	str = fb_json_values_next_str(values, NULL);
 	url = fb_json_values_next_str(values, NULL);
 
+	if ((str == NULL) || (url == NULL)) {
+		g_propagate_error(error, err);
+		g_object_unref(values);
+		return NULL;
+	}
+
 	if (purple_strequal(str, "ExternalUrl")) {
 		params = fb_http_params_new_parse(url, TRUE);
 		text = fb_http_params_dup_str(params, "u", NULL);

_______________________________________________
Commits mailing list
[email protected]
https://pidgin.im/cgi-bin/mailman/listinfo/commits
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.