Prevent crash

pull/213/head
M66B 2 years ago
parent f422ab5b03
commit 084a2789c8

@ -576,11 +576,12 @@ public class CloudSync {
return responses.get(0); return responses.get(0);
else { else {
JSONArray jall = new JSONArray(); JSONArray jall = new JSONArray();
for (JSONObject response : responses) { for (JSONObject response : responses)
JSONArray jitems = response.getJSONArray("items"); if (response.has("items")) {
for (int i = 0; i < jitems.length(); i++) JSONArray jitems = response.getJSONArray("items");
jall.put(jitems.getJSONObject(i)); for (int i = 0; i < jitems.length(); i++)
} jall.put(jitems.getJSONObject(i));
}
JSONObject jresponse = responses.get(0); JSONObject jresponse = responses.get(0);
jresponse.put("items", jall); jresponse.put("items", jall);
return jresponse; return jresponse;

Loading…
Cancel
Save