1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-28 12:56:49 +01:00

Fix crash when connecting on some phones

This commit is contained in:
José Rebelo 2024-04-03 21:22:52 +01:00
parent 25135b9144
commit 64a0b716f0

View File

@ -52,6 +52,7 @@ import org.slf4j.LoggerFactory;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.UUID;
@ -600,7 +601,7 @@ public class DeviceCommunicationService extends Service implements SharedPrefere
continue;
}
final Set<String> lastDeviceAddresses = prefs.getStringSet(GBPrefs.LAST_DEVICE_ADDRESSES, Collections.emptySet());
final Set<String> lastDeviceAddresses = new HashSet<>(prefs.getStringSet(GBPrefs.LAST_DEVICE_ADDRESSES, Collections.emptySet()));
if (!lastDeviceAddresses.contains(btDeviceAddress)) {
lastDeviceAddresses.add(btDeviceAddress);