summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--web/react/components/mention_list.jsx4
-rw-r--r--web/templates/head.html5
2 files changed, 5 insertions, 4 deletions
diff --git a/web/react/components/mention_list.jsx b/web/react/components/mention_list.jsx
index 524f1b337..7e939812d 100644
--- a/web/react/components/mention_list.jsx
+++ b/web/react/components/mention_list.jsx
@@ -188,8 +188,8 @@ module.exports = React.createClass({
for (var i = 0; i < users.length && index < MAX_ITEMS_IN_LIST; i++) {
if (this.alreadyMentioned(users[i].username)) continue;
- if (users[i].first_name.lastIndexOf(mentionText,0) === 0
- || users[i].last_name.lastIndexOf(mentionText,0) === 0 || users[i].username.lastIndexOf(mentionText,0) === 0) {
+ if ((users[i].first_name && users[i].first_name.lastIndexOf(mentionText,0) === 0)
+ || (users[i].last_name && users[i].last_name.lastIndexOf(mentionText,0) === 0) || users[i].username.lastIndexOf(mentionText,0) === 0) {
mentions[index] = (
<Mention
ref={'mention' + index}
diff --git a/web/templates/head.html b/web/templates/head.html
index 0cbda28c5..d14340998 100644
--- a/web/templates/head.html
+++ b/web/templates/head.html
@@ -42,6 +42,9 @@
}
config.SiteName = '{{ .SiteName }}';
</script>
+
+ <script src="/static/js/bundle.js"></script>
+
<script>
if (config.LogglyWriteKey != null && config.LogglyWriteKey !== "") {
var _LTracker = _LTracker || [];
@@ -101,7 +104,5 @@
}
</script>
<!-- Snowplow stops plowing -->
-
- <script src="/static/js/bundle.js"></script>
</head>
{{end}}