1
0
Fork 0
mirror of https://github.com/syncthing/syncthing-android.git synced 2024-11-23 04:41:16 +00:00

Use optString, added link.

This commit is contained in:
Felix Ableitner 2015-05-23 17:31:59 +02:00
parent 9e232254ab
commit 86d50d75ff

View file

@ -529,11 +529,9 @@ public class RestApi implements SyncthingService.OnWebGuiAvailableListener,
Folder r = new Folder();
r.path = json.getString("path");
r.id = json.getString("id");
if (json.has("invalid")) {
r.invalid = json.getString("invalid"); // TODO Upstream bug
} else {
r.invalid = "";
}
// TODO: Field seems to be missing sometimes.
// https://github.com/syncthing/syncthing-android/issues/291
r.invalid = json.optString("invalid");
r.deviceIds = new ArrayList<>();
JSONArray devices = json.getJSONArray("devices");
for (int j = 0; j < devices.length(); j++) {