mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 18:40:39 +00:00
Skip invalid contact records
This commit is contained in:
parent
0001a9b300
commit
795b73df87
1 changed files with 11 additions and 1 deletions
|
@ -2320,7 +2320,17 @@ public class Manager implements Closeable {
|
||||||
.asPointer(), tmpFile)) {
|
.asPointer(), tmpFile)) {
|
||||||
var s = new DeviceContactsInputStream(attachmentAsStream);
|
var s = new DeviceContactsInputStream(attachmentAsStream);
|
||||||
DeviceContact c;
|
DeviceContact c;
|
||||||
while ((c = s.read()) != null) {
|
while (true) {
|
||||||
|
try {
|
||||||
|
c = s.read();
|
||||||
|
} catch (IOException e) {
|
||||||
|
logger.warn("Sync contacts contained invalid contact, ignoring: {}",
|
||||||
|
e.getMessage());
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (c == null) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
if (c.getAddress().matches(account.getSelfAddress()) && c.getProfileKey().isPresent()) {
|
if (c.getAddress().matches(account.getSelfAddress()) && c.getProfileKey().isPresent()) {
|
||||||
account.setProfileKey(c.getProfileKey().get());
|
account.setProfileKey(c.getProfileKey().get());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue