1
0
Fork 0
mirror of https://github.com/syncthing/syncthing-android.git synced 2025-01-10 20:15:54 +00:00

Fixed possible crash in RestApi (reported on Google Play)

This commit is contained in:
Felix Ableitner 2016-08-19 02:49:55 +02:00
parent c467ef7792
commit 972f38755a

View file

@ -422,7 +422,11 @@ public class RestApi implements SyncthingService.OnWebGuiAvailableListener,
n.deviceID = json.getString("deviceID");
n.compression = json.getString("compression");
n.introducer = json.getBoolean("introducer");
if (includeLocal || !mLocalDeviceId.equals(n.deviceID)) {
// Use null-save check because mLocalDeviceId might not be initialized yet.
// Should be replaced with Object.equals() when that becomes available in Android.
boolean sameId = (mLocalDeviceId == n.deviceID) ||
(mLocalDeviceId != null && mLocalDeviceId.equals(n.deviceID));
if (includeLocal || !sameId) {
ret.add(n);
}
}