Skip to content

Node.js based forum software built for the modern web

fixing crash when utils.slugify is called with a null value

Julian Lam89bf036262c2
diff --git a/public/src/utils.js b/public/src/utils.js
index f345ab2a22..1521d53e28 100644
--- a/public/src/utils.js
+++ b/public/src/utils.js
@@ -75,6 +75,7 @@
//http://dense13.com/blog/2009/05/03/converting-string-to-slug-javascript/
slugify: function(str) {
+ if (!str) { str = ''; }
str = str.replace(utils.trimRegex, '');
if(utils.isLatin.test(str)) {
str = str.replace(utils.invalidLatinChars, '-');