From 61003bd535e6a29f6de92a1113a59acaa0e4658e Mon Sep 17 00:00:00 2001 From: Tim Su Date: Mon, 7 Feb 2011 17:59:30 -0800 Subject: [PATCH] Producteev: Fix case where there is no array returned in json invocation --- .../com/todoroo/astrid/producteev/api/ProducteevInvoker.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/astrid/plugin-src/com/todoroo/astrid/producteev/api/ProducteevInvoker.java b/astrid/plugin-src/com/todoroo/astrid/producteev/api/ProducteevInvoker.java index a39ae1ffd..a4b8a1bbc 100644 --- a/astrid/plugin-src/com/todoroo/astrid/producteev/api/ProducteevInvoker.java +++ b/astrid/plugin-src/com/todoroo/astrid/producteev/api/ProducteevInvoker.java @@ -656,6 +656,8 @@ public class ProducteevInvoker { */ private JSONArray getResponse(JSONObject response, String field) throws ApiResponseParseException { try { + if(!response.has(field)) + return new JSONArray(); return response.getJSONArray(field); } catch (JSONException e) { throw new ApiResponseParseException(e);