fix: crash if unreadTopics is undefined

v1.18.x
Barış Soner Uşaklı 4 years ago
parent 5b0d068ccd
commit 617f4730a0

@ -129,7 +129,7 @@ define('forum/unread', [
var unreadTopics = app.user.unreadData;
function onNewPost(data) {
if (data && data.posts && data.posts.length) {
if (data && data.posts && data.posts.length && unreadTopics) {
var post = data.posts[0];
if (parseInt(post.uid, 10) === parseInt(app.user.uid, 10) ||
(!post.topic.isFollowing && post.categoryWatchState !== watchStates.watching)

Loading…
Cancel
Save