summaryrefslogtreecommitdiffstats
path: root/web/react/components/sidebar.jsx
diff options
context:
space:
mode:
authorJoramWilander <jwawilander@gmail.com>2016-02-01 08:01:49 -0500
committerJoramWilander <jwawilander@gmail.com>2016-02-01 08:01:49 -0500
commit12efe8675e5f0591308c10949174e64e42eb1f04 (patch)
tree197416e8072c45f5da6eddf8e98d0f0b93860f2d /web/react/components/sidebar.jsx
parent0b022b130a6a4d4c3984fc7d021b2817b56480a1 (diff)
downloadchat-12efe8675e5f0591308c10949174e64e42eb1f04.tar.gz
chat-12efe8675e5f0591308c10949174e64e42eb1f04.tar.bz2
chat-12efe8675e5f0591308c10949174e64e42eb1f04.zip
Fix console errors
Diffstat (limited to 'web/react/components/sidebar.jsx')
-rw-r--r--web/react/components/sidebar.jsx5
1 files changed, 4 insertions, 1 deletions
diff --git a/web/react/components/sidebar.jsx b/web/react/components/sidebar.jsx
index c902731c9..fdd069bb2 100644
--- a/web/react/components/sidebar.jsx
+++ b/web/react/components/sidebar.jsx
@@ -182,7 +182,10 @@ export default class Sidebar extends React.Component {
let currentChannelName = channel.display_name;
if (channel.type === 'D') {
- currentChannelName = Utils.getDirectTeammate(channel.id).username;
+ const teammate = Utils.getDirectTeammate(channel.id);
+ if (teammate != null) {
+ currentChannelName = teammate.username;
+ }
}
const unread = this.getTotalUnreadCount();