mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 10:49:06 +01:00
Merge branch '2059-no-such-group-exception' into 'master'
Check if group still exists before storing MessageId of thread position Closes #2059 See merge request briar/briar!1477
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.db.DatabaseExecutor;
|
||||
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.event.Event;
|
||||
import org.briarproject.bramble.api.event.EventBus;
|
||||
@@ -215,11 +216,15 @@ public abstract class ThreadListViewModel<I extends ThreadItem>
|
||||
return replyId;
|
||||
}
|
||||
|
||||
@UiThread
|
||||
void storeMessageId(@Nullable MessageId messageId) {
|
||||
if (messageId != null) {
|
||||
runOnDbThread(() -> {
|
||||
try {
|
||||
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) {
|
||||
handleException(e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user