1
0
Fork 0
mirror of https://github.com/geometer/FBReaderJ.git synced 2025-10-05 02:39:23 +02:00

fixed server response processing

This commit is contained in:
Nikolay Pultsin 2014-07-07 04:46:46 +01:00
parent dff1212c1e
commit c1376587c4

View file

@ -155,10 +155,12 @@ public class SynchroniserService extends Service implements IBookCollection.List
List<String> hashes = null;
String error = null;
try {
if (response instanceof Map) {
id = (String)((Map)response).get("id");
hashes = (List<String>)((Map)response).get("hashes");
error = (String)((Map)response).get("error");
final List<Map> responseList = (List<Map>)response;
if (responseList.size() == 1) {
final Map resultMap = (Map)responseList.get(0).get("result");
id = (String)resultMap.get("id");
hashes = (List<String>)resultMap.get("hashes");
error = (String)resultMap.get("error");
}
} catch (Exception e) {
// ignore