summaryrefslogtreecommitdiffstats
path: root/packages/gitbook-html/lib/langs.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2016-02-20 17:23:31 +0100
committerSamy Pessé <samypesse@gmail.com>2016-12-22 12:32:15 +0100
commitcdec338fff6e7e34e1a1b7d387f7846d52be31f3 (patch)
tree4d0ab666aecd0a737509951e3d5f5e8f3c8e852c /packages/gitbook-html/lib/langs.js
parent4cde40f5d34a0076f2521483dc8b3bdb1e757c4b (diff)
downloadgitbook-cdec338fff6e7e34e1a1b7d387f7846d52be31f3.zip
gitbook-cdec338fff6e7e34e1a1b7d387f7846d52be31f3.tar.gz
gitbook-cdec338fff6e7e34e1a1b7d387f7846d52be31f3.tar.bz2
Don't fail when no entry in LANGS
Diffstat (limited to 'packages/gitbook-html/lib/langs.js')
-rwxr-xr-xpackages/gitbook-html/lib/langs.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/packages/gitbook-html/lib/langs.js b/packages/gitbook-html/lib/langs.js
index 035091b..d337e0f 100755
--- a/packages/gitbook-html/lib/langs.js
+++ b/packages/gitbook-html/lib/langs.js
@@ -3,7 +3,9 @@ var parseSummary = require('./summary');
// HTML -> Languages
function parseLangs(content) {
- return parseSummary(content).parts[0].articles;
+ var parts = parseSummary(content).parts;
+ if (parts.length > 0) return parts[0].articles;
+ return [];
}
module.exports = parseLangs;