mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-02-28 09:31:17 +01:00
fix: crash if unreadTopics is undefined
This commit is contained in:
@@ -129,7 +129,7 @@ define('forum/unread', [
|
|||||||
var unreadTopics = app.user.unreadData;
|
var unreadTopics = app.user.unreadData;
|
||||||
|
|
||||||
function onNewPost(data) {
|
function onNewPost(data) {
|
||||||
if (data && data.posts && data.posts.length) {
|
if (data && data.posts && data.posts.length && unreadTopics) {
|
||||||
var post = data.posts[0];
|
var post = data.posts[0];
|
||||||
if (parseInt(post.uid, 10) === parseInt(app.user.uid, 10) ||
|
if (parseInt(post.uid, 10) === parseInt(app.user.uid, 10) ||
|
||||||
(!post.topic.isFollowing && post.categoryWatchState !== watchStates.watching)
|
(!post.topic.isFollowing && post.categoryWatchState !== watchStates.watching)
|
||||||
|
|||||||
Reference in New Issue
Block a user