fix topic creation regression caused by 576df84218

This commit is contained in:
Julian Lam
2016-11-21 11:18:10 -05:00
parent f0936fcafb
commit 5916530a35

View File

@@ -329,7 +329,9 @@ module.exports = function (Topics) {
function check(item, min, max, minError, maxError, callback) {
// Trim and remove HTML (latter for composers that send in HTML, like redactor)
item = S(item.trim()).stripTags().s;
if (typeof item === 'string') {
item = S(item.trim()).stripTags().s;
}
if (!item || item.length < parseInt(min, 10)) {
return callback(new Error('[[error:' + minError + ', ' + min + ']]'));