From b2329a79b411af393af90853dae3c6ad9005e361 Mon Sep 17 00:00:00 2001 From: Alex Ling Date: Tue, 18 Jan 2022 15:02:16 +0000 Subject: [PATCH] Gracefully handle nullish fields --- public/js/plugin-download.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/js/plugin-download.js b/public/js/plugin-download.js index 2346fe2..11c047c 100644 --- a/public/js/plugin-download.js +++ b/public/js/plugin-download.js @@ -70,7 +70,7 @@ const buildTable = (chapters) => { const rows = chapters.map(ch => { const tds = Object.values(ch).map(v => { const maxLength = 40; - const shouldShrink = v.length > maxLength; + const shouldShrink = v && v.length > maxLength; const content = shouldShrink ? `${v.substring(0, maxLength)}...
${v}
` : v; return `${content}` }).join('');