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(); Folder r = new Folder();
r.path = json.getString("path"); r.path = json.getString("path");
r.id = json.getString("id"); r.id = json.getString("id");
if (json.has("invalid")) { // TODO: Field seems to be missing sometimes.
r.invalid = json.getString("invalid"); // TODO Upstream bug // https://github.com/syncthing/syncthing-android/issues/291
} else { r.invalid = json.optString("invalid");
r.invalid = "";
}
r.deviceIds = new ArrayList<>(); r.deviceIds = new ArrayList<>();
JSONArray devices = json.getJSONArray("devices"); JSONArray devices = json.getJSONArray("devices");
for (int j = 0; j < devices.length(); j++) { for (int j = 0; j < devices.length(); j++) {