make sure title is defined for home page usage

This commit is contained in:
ansuz
2016-06-30 15:53:13 +02:00
parent 0911572031
commit 8a82e11306
2 changed files with 7 additions and 8 deletions

View File

@@ -162,7 +162,7 @@
};
var truncateTitle = function (title, len) {
if (title.length > len) {
if (typeof(title) === 'string' && title.length > len) {
return title.slice(0, len) + '…';
}
return title;