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

James Geboski jgeboski at gmail.com
Wed Aug 26 19:48:38 EDT 2015


Changeset: 6a0a79182ebc0eaeb127572bc1fc90c948aad7ee
Author:	 James Geboski <jgeboski at gmail.com>
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);



More information about the Commits mailing list