diff --git a/Habitica/src/com/habitrpg/android/habitica/ui/adapter/ChatRecyclerViewAdapter.java b/Habitica/src/com/habitrpg/android/habitica/ui/adapter/ChatRecyclerViewAdapter.java index 23944abec..79f530751 100644 --- a/Habitica/src/com/habitrpg/android/habitica/ui/adapter/ChatRecyclerViewAdapter.java +++ b/Habitica/src/com/habitrpg/android/habitica/ui/adapter/ChatRecyclerViewAdapter.java @@ -249,13 +249,15 @@ public class ChatRecyclerViewAdapter extends RecyclerView.Adapter e : msg.likes.entrySet()) { - if (e.getValue()) { - likeCount++; - } + if(msg != null && msg.likes != null) { + for (Map.Entry e : msg.likes.entrySet()) { + if (e.getValue()) { + likeCount++; + } - if (e.getKey().equals(uuid)) { - currentUserLikedPost = true; + if (e.getKey().equals(uuid)) { + currentUserLikedPost = true; + } } }