1
0
Fork 0
mirror of https://github.com/syncthing/syncthing-android.git synced 2024-11-22 20:31:16 +00:00

Catch missing json field (fixes #291)

This commit is contained in:
Lode Hoste 2015-05-06 07:59:48 +02:00
parent 9ef1474cbe
commit e317b11c57

View file

@ -519,7 +519,11 @@ public class RestApi implements SyncthingService.OnWebGuiAvailableListener,
Folder r = new Folder();
r.path = json.getString("path");
r.id = json.getString("id");
r.invalid = json.getString("invalid");
if (json.has("invalid")) {
r.invalid = json.getString("invalid"); // TODO Upstream bug
} else {
r.invalid = "";
}
r.deviceIds = new ArrayList<>();
JSONArray devices = json.getJSONArray("devices");
for (int j = 0; j < devices.length(); j++) {