diff --git a/lib/formattingTools.js b/lib/formattingTools.js index 8118d5b4..d4550f8f 100644 --- a/lib/formattingTools.js +++ b/lib/formattingTools.js @@ -15,7 +15,8 @@ const s = require('./symbols'); function gentitle(titles, type) { const [firsttitle] = titles; const lasttitle = [...titles].pop(); - if (titles.length === 1) { + + if (titles.length === 1 && firsttitle !== undefined) { return firsttitle; } if (lasttitle) { @@ -24,6 +25,9 @@ function gentitle(titles, type) { if (typeof type === 'string') { return i18n`Untitled ${type} in ${firsttitle}`; } + if (firsttitle === undefined) { + return i18n`Untitled Schema`; + } return i18n`Untitled undefined type in ${firsttitle}`; }