diff options
author | Joram Wilander <jwawilander@gmail.com> | 2016-07-07 08:02:17 -0400 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2016-07-07 08:02:17 -0400 |
commit | df33348704bea75e8ba11821f80040ed1702eaa2 (patch) | |
tree | 54b5e3e31e698059355cd848c7fadd1cbb7eb32b /webapp/stores/post_store.jsx | |
parent | c1624af6d6fccbbc5f4a48fe93a837f592a19818 (diff) | |
download | chat-df33348704bea75e8ba11821f80040ed1702eaa2.tar.gz chat-df33348704bea75e8ba11821f80040ed1702eaa2.tar.bz2 chat-df33348704bea75e8ba11821f80040ed1702eaa2.zip |
Fix javascript error when getting a nottification about a reply in a channel not loaded (#3518)
Diffstat (limited to 'webapp/stores/post_store.jsx')
-rw-r--r-- | webapp/stores/post_store.jsx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/webapp/stores/post_store.jsx b/webapp/stores/post_store.jsx index b77c7bd3c..1c9a877cf 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)) { |