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:
parent
9ef1474cbe
commit
e317b11c57
1 changed files with 5 additions and 1 deletions
|
@ -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++) {
|
||||
|
|
Loading…
Reference in a new issue