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:
parent
dff1212c1e
commit
c1376587c4
1 changed files with 6 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue