mirror of
https://github.com/oxen-io/session-android.git
synced 2025-01-11 22:33:38 +00:00
Fix crash.
This commit is contained in:
parent
b74506ea24
commit
a1e98bae75
@ -361,17 +361,23 @@ public class PushGroupSendJob extends PushSendJob implements InjectableType {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Add secondary devices to the list. We shouldn't add our secondary devices
|
// Add secondary devices to the list. We shouldn't add our secondary devices
|
||||||
for (Address member : memberSet) {
|
try {
|
||||||
if (!member.isPhone() || member.serialize().equalsIgnoreCase(localNumber)) { continue; }
|
Set<Address> originalMemberSet = new HashSet<>(memberSet);
|
||||||
try {
|
for (Address member : originalMemberSet) {
|
||||||
List<String> secondaryDevices = PromiseUtil.timeout(LokiStorageAPI.shared.getSecondaryDevicePublicKeys(member.serialize()), 5000).get();
|
if (!member.isPhone() || member.serialize().equalsIgnoreCase(localNumber)) { continue; }
|
||||||
memberSet.addAll(Stream.of(secondaryDevices).map(string -> {
|
|
||||||
// Loki - Calling .map(Address::fromSerialized) is causing errors, thus we use the long method :(
|
try {
|
||||||
return Address.fromSerialized(string);
|
List<String> secondaryDevices = PromiseUtil.timeout(LokiStorageAPI.shared.getSecondaryDevicePublicKeys(member.serialize()), 5000).get();
|
||||||
}).toList());
|
memberSet.addAll(Stream.of(secondaryDevices).map(string -> {
|
||||||
} catch (Exception e) {
|
// Loki - Calling .map(Address::fromSerialized) is causing errors, thus we use the long method :(
|
||||||
// Timed out, go to the next member
|
return Address.fromSerialized(string);
|
||||||
|
}).toList());
|
||||||
|
} catch (Exception e) {
|
||||||
|
// Timed out, go to the next member
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
Log.e("PushGroupSend", "Error occurred while adding secondary devices: " + e);
|
||||||
}
|
}
|
||||||
|
|
||||||
return new LinkedList<>(memberSet);
|
return new LinkedList<>(memberSet);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user