diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx
index ce803c2fb4..e6c460959a 100644
--- a/web/react/utils/utils.jsx
+++ b/web/react/utils/utils.jsx
@@ -231,11 +231,11 @@ module.exports.extractLinks = function(text) {
var repRegex = new RegExp("
", "g");
var matches = testUrlMatch(text.replace(repRegex, "\n"));
- if (!matches) return { "links": null, "text": text };
+ if (!matches.length) return { "links": null, "text": text };
- var links = []
+ var links = [];
for (var i = 0; i < matches.length; i++) {
- links.push(matches[i].link)
+ links.push(matches[i].link);
}
return { "links": links, "text": text };
@@ -450,9 +450,9 @@ module.exports.textToJsx = function(text, options) {
inner.push({prefix}@{name}{suffix} );
} else if (testUrlMatch(word).length) {
var match = testUrlMatch(word)[0];
- var link = match.link
+ var link = match.link;
- var prefix = word.substring(0,word.indexOf(match.text))
+ var prefix = word.substring(0,word.indexOf(match.text));
var suffix = word.substring(word.indexOf(match.text)+match.text.length);
inner.push({prefix}{match.text}{suffix} );