summaryrefslogtreecommitdiffstats
path: root/webapp/stores/post_store.jsx
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2016-07-07 08:02:17 -0400
committerChristopher Speller <crspeller@gmail.com>2016-07-07 08:02:17 -0400
commitdf33348704bea75e8ba11821f80040ed1702eaa2 (patch)
tree54b5e3e31e698059355cd848c7fadd1cbb7eb32b /webapp/stores/post_store.jsx
parentc1624af6d6fccbbc5f4a48fe93a837f592a19818 (diff)
downloadchat-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.jsx7
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)) {