mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-14 19:59:05 +01:00
Ignore NoSuchGroupException when storing MessageId of thread position for removed group
This commit is contained in:
@@ -5,6 +5,7 @@ import android.app.Application;
|
|||||||
import org.briarproject.bramble.api.crypto.CryptoExecutor;
|
import org.briarproject.bramble.api.crypto.CryptoExecutor;
|
||||||
import org.briarproject.bramble.api.db.DatabaseExecutor;
|
import org.briarproject.bramble.api.db.DatabaseExecutor;
|
||||||
import org.briarproject.bramble.api.db.DbException;
|
import org.briarproject.bramble.api.db.DbException;
|
||||||
|
import org.briarproject.bramble.api.db.NoSuchGroupException;
|
||||||
import org.briarproject.bramble.api.db.TransactionManager;
|
import org.briarproject.bramble.api.db.TransactionManager;
|
||||||
import org.briarproject.bramble.api.event.Event;
|
import org.briarproject.bramble.api.event.Event;
|
||||||
import org.briarproject.bramble.api.event.EventBus;
|
import org.briarproject.bramble.api.event.EventBus;
|
||||||
@@ -215,11 +216,15 @@ public abstract class ThreadListViewModel<I extends ThreadItem>
|
|||||||
return replyId;
|
return replyId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@UiThread
|
||||||
void storeMessageId(@Nullable MessageId messageId) {
|
void storeMessageId(@Nullable MessageId messageId) {
|
||||||
if (messageId != null) {
|
if (messageId != null) {
|
||||||
runOnDbThread(() -> {
|
runOnDbThread(() -> {
|
||||||
try {
|
try {
|
||||||
messageTracker.storeMessageId(groupId, messageId);
|
messageTracker.storeMessageId(groupId, messageId);
|
||||||
|
} catch (NoSuchGroupException e) {
|
||||||
|
// This can happen when the activity is closed
|
||||||
|
// after deleting the group. So just ignore this case.
|
||||||
} catch (DbException e) {
|
} catch (DbException e) {
|
||||||
handleException(e);
|
handleException(e);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user