diff options
author | Samy Pessé <samypesse@gmail.com> | 2016-05-10 12:12:19 +0200 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2016-05-10 12:12:19 +0200 |
commit | d342d31c8e2dd8e18ddaf863edecc5b1cb82cb98 (patch) | |
tree | 6e46151d962cdc6fff7fe09ef30591a3eb31de47 /lib/models/summary.js | |
parent | 5b3f54fbc85dc70d6c2a5dc7fbcc70a29d4f1204 (diff) | |
download | gitbook-d342d31c8e2dd8e18ddaf863edecc5b1cb82cb98.zip gitbook-d342d31c8e2dd8e18ddaf863edecc5b1cb82cb98.tar.gz gitbook-d342d31c8e2dd8e18ddaf863edecc5b1cb82cb98.tar.bz2 |
Fix error when summary contains entry without ref
Diffstat (limited to 'lib/models/summary.js')
-rw-r--r-- | lib/models/summary.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/models/summary.js b/lib/models/summary.js index 8a4afc7..70f0535 100644 --- a/lib/models/summary.js +++ b/lib/models/summary.js @@ -74,7 +74,12 @@ Summary.prototype.getByLevel = function(level) { */ Summary.prototype.getByPath = function(filePath) { return this.getArticle(function(article) { - return (LocationUtils.areIdenticalPaths(article.getPath(), filePath)); + var articlePath = article.getPath(); + + return ( + articlePath && + LocationUtils.areIdenticalPaths(articlePath, filePath) + ); }); }; |