Check whether contact group exists before using it.

This commit is contained in:
akwizgran
2018-04-16 14:50:52 +01:00
parent a9f77f0f90
commit cf396c2ce2

View File

@@ -96,6 +96,9 @@ class ClientVersioningManagerImpl implements ClientVersioningManager, Client,
try {
Contact contact = db.getContact(txn, contactId);
Group g = getContactGroup(contact);
// Contact may be in the process of being added or removed, so
// contact group may not exist
if (!db.containsGroup(txn, g.getId())) return INVISIBLE;
LatestUpdates latest = findLatestUpdates(txn, g.getId());
if (latest.local == null) throw new DbException();
if (latest.remote == null) return INVISIBLE;