aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2012-11-05 09:46:06 +0100
committerWilmer van der Gaast <wilmer@gaast.net>2012-11-05 09:46:06 +0100
commit0688e99d12297b6dda980803d1f1a54bf8590299 (patch)
tree70bb890305cc9f80edb351018cfae784a7b3ff46
parente08ae0cff03ff880344cb3dc75cc90576cc314b3 (diff)
Type safety check.
-rw-r--r--protocols/twitter/twitter_lib.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/protocols/twitter/twitter_lib.c b/protocols/twitter/twitter_lib.c
index dad97495..a4ce28e7 100644
--- a/protocols/twitter/twitter_lib.c
+++ b/protocols/twitter/twitter_lib.c
@@ -188,6 +188,7 @@ char *twitter_parse_error(struct http_request *req)
return ret ? ret : req->status_string;
}
+/* TODO: NULL means failure, but not always that the connection is dead. This sucks for callers. */
static json_value *twitter_parse_response(struct im_connection *ic, struct http_request *req)
{
gboolean logging_in = !(ic->flags & OPT_LOGGED_IN);
@@ -266,6 +267,9 @@ static xt_status twitter_xt_get_friends_id_list(json_value *node, struct twitter
return XT_ABORT;
for (i = 0; i < c->u.array.length; i ++) {
+ if (c->u.array.values[i]->type != json_integer)
+ continue;
+
txl->list = g_slist_prepend(txl->list,
g_strdup_printf("%ld", c->u.array.values[i]->u.integer));