summaryrefslogtreecommitdiffstats
path: root/web/react/components/search_results.jsx
diff options
context:
space:
mode:
authorReed Garmsen <rgarmsen2295@gmail.com>2016-02-10 09:30:35 -0800
committerReed Garmsen <rgarmsen2295@gmail.com>2016-02-10 09:31:40 -0800
commite322774d74dfdc4f191289a88cd42d84aba727fb (patch)
tree8471c2039bd3c23a2e372015be1e87fdd31fdb19 /web/react/components/search_results.jsx
parent00795908f62aa28d6717199cf727a4bbf22a105a (diff)
downloadchat-e322774d74dfdc4f191289a88cd42d84aba727fb.tar.gz
chat-e322774d74dfdc4f191289a88cd42d84aba727fb.tar.bz2
chat-e322774d74dfdc4f191289a88cd42d84aba727fb.zip
Fix issue with searching for short strings
Diffstat (limited to 'web/react/components/search_results.jsx')
-rw-r--r--web/react/components/search_results.jsx15
1 files changed, 9 insertions, 6 deletions
diff --git a/web/react/components/search_results.jsx b/web/react/components/search_results.jsx
index 4adc3afe0..12c066734 100644
--- a/web/react/components/search_results.jsx
+++ b/web/react/components/search_results.jsx
@@ -15,13 +15,16 @@ function getStateFromStores() {
const results = SearchStore.getSearchResults();
const channels = new Map();
- const channelIds = results.order.map((postId) => results.posts[postId].channel_id);
- for (const id of channelIds) {
- if (channels.has(id)) {
- continue;
- }
- channels.set(id, ChannelStore.get(id));
+ if (results && results.order) {
+ const channelIds = results.order.map((postId) => results.posts[postId].channel_id);
+ for (const id of channelIds) {
+ if (channels.has(id)) {
+ continue;
+ }
+
+ channels.set(id, ChannelStore.get(id));
+ }
}
return {