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:
parent
c467ef7792
commit
972f38755a
1 changed files with 5 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue