Skip to content
Snippets Groups Projects
Commit e5b2275c authored by akwizgran's avatar akwizgran
Browse files

Merge branch '1947-forum-crash' into 'master'

Don't add new thread items when the existing ones haven't loaded

Closes #1947

See merge request briar/briar!1375
parents 6fbc82ee 51595938
No related branches found
No related tags found
No related merge requests found
......@@ -197,6 +197,10 @@ public abstract class ThreadListViewModel<I extends ThreadItem>
*/
@UiThread
protected void addItem(I item, boolean scrollToItem) {
// If items haven't loaded, we need to wait until they have.
// Since this was a R/W DB transaction, the load will pick up this item.
if (items.getValue() == null) return;
messageTree.add(item);
if (scrollToItem) this.scrollToItem.set(item.getId());
items.setValue(new LiveResult<>(messageTree.depthFirstOrder()));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment