From df33348704bea75e8ba11821f80040ed1702eaa2 Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Thu, 7 Jul 2016 08:02:17 -0400 Subject: [PATCH] Fix javascript error when getting a nottification about a reply in a channel not loaded (#3518) --- webapp/stores/post_store.jsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/webapp/stores/post_store.jsx b/webapp/stores/post_store.jsx index b77c7bd3cd..1c9a877cf5 100644 --- a/webapp/stores/post_store.jsx +++ b/webapp/stores/post_store.jsx @@ -92,7 +92,12 @@ class PostStoreClass extends EventEmitter { } getPost(channelId, postId) { - const posts = this.postsInfo[channelId].postList; + const postInfo = this.postsInfo[channelId]; + if (postInfo == null) { + return null; + } + + const posts = postInfo.postList; let post = null; if (posts.posts.hasOwnProperty(postId)) {