threadpresenter: add null check for thread to findPostById.

refactor-toolbar
Floens 8 years ago
parent 16ef48f65b
commit c8553bc9cf
  1. 5
      Clover/app/src/main/java/org/floens/chan/core/presenter/ThreadPresenter.java

@ -709,11 +709,14 @@ public class ThreadPresenter implements ChanLoader.ChanLoaderCallback, PostAdapt
}
private Post findPostById(int id) {
for (Post post : chanLoader.getThread().posts) {
ChanThread thread = chanLoader.getThread();
if (thread != null) {
for (Post post : thread.posts) {
if (post.no == id) {
return post;
}
}
}
return null;
}

Loading…
Cancel
Save