summaryrefslogtreecommitdiffstats
path: root/lib/models/summary.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2016-05-10 12:12:19 +0200
committerSamy Pessé <samypesse@gmail.com>2016-05-10 12:12:19 +0200
commitd342d31c8e2dd8e18ddaf863edecc5b1cb82cb98 (patch)
tree6e46151d962cdc6fff7fe09ef30591a3eb31de47 /lib/models/summary.js
parent5b3f54fbc85dc70d6c2a5dc7fbcc70a29d4f1204 (diff)
downloadgitbook-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.js7
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)
+ );
});
};