diff options
author | Christopher Speller <crspeller@gmail.com> | 2016-02-11 08:07:22 -0500 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2016-02-11 08:07:22 -0500 |
commit | 8291fdd681b840514f54d787a8f4f1f6b1c4d367 (patch) | |
tree | 5d20a826ed2afaa212179fcfdf256de8af39975b /web/react/components/search_results.jsx | |
parent | 843d83c8725938a29e26243f0d0fbcae9dfceefc (diff) | |
parent | e322774d74dfdc4f191289a88cd42d84aba727fb (diff) | |
download | chat-8291fdd681b840514f54d787a8f4f1f6b1c4d367.tar.gz chat-8291fdd681b840514f54d787a8f4f1f6b1c4d367.tar.bz2 chat-8291fdd681b840514f54d787a8f4f1f6b1c4d367.zip |
Merge pull request #2141 from rgarmsen2295/fix-search-map-error
RC2 - Fix issue with searching for short strings
Diffstat (limited to 'web/react/components/search_results.jsx')
-rw-r--r-- | web/react/components/search_results.jsx | 15 |
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 { |