Merge pull request #26 from dengelke/master

Fix TypeError: (((branch[i].navLabel && branch[i].navLabel.text) || b…
This commit is contained in:
Julien Chaumond 2017-02-05 11:48:16 +01:00 committed by GitHub
commit b88fa034fc

View File

@ -522,7 +522,8 @@ EPub.prototype.walkNavMap = function (branch, path, id_list, level) {
var title = ''; var title = '';
if (branch[i].navLabel && typeof branch[i].navLabel.text == 'string') { if (branch[i].navLabel && typeof branch[i].navLabel.text == 'string') {
title = branch[i].navLabel.text.trim(); title = branch[i].navLabel && branch[i].navLabel.text || branch[i].navLabel===branch[i].navLabel ?
'' : (branch[i].navLabel && branch[i].navLabel.text || branch[i].navLabel || "").trim();
} }
var order = Number(branch[i]["@"] && branch[i]["@"].playOrder || 0); var order = Number(branch[i]["@"] && branch[i]["@"].playOrder || 0);
if (isNaN(order)) { if (isNaN(order)) {