From 5a9dbf85ecfee38577c5468f4a8a000de79aa54d Mon Sep 17 00:00:00 2001 From: Emmanuel Engelhart Date: Mon, 24 Jan 2022 08:35:36 +0100 Subject: [PATCH] Fix title='_' case too #685 --- static/skin/index.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/static/skin/index.js b/static/skin/index.js index ef4bc48ca..7e9e83f12 100644 --- a/static/skin/index.js +++ b/static/skin/index.js @@ -55,10 +55,11 @@ const humanFriendlyTitle = (title) => { if (typeof title === 'string' && title.length > 0) { title = title.replace(/_/g, ' '); - return htmlEncode(title[0].toUpperCase() + title.slice(1)); - } else { - return ''; + if (title.length > 0) { + return htmlEncode(title[0].toUpperCase() + title.slice(1)); + } } + return ''; } function htmlEncode(str) {