From 6ae89c675ddefe703bafeddd311b073fa329e1c6 Mon Sep 17 00:00:00 2001 From: Julien Vanier Date: Mon, 6 Jun 2016 16:45:57 -0400 Subject: [PATCH] No context for narrative sections When using `--config configuration.yml` with narrative sections, `documentation build` crashes with `TypeError: Cannot read property 'github' of undefined` (regardless if `--github` is passed or not). Verify that the `comment.context` object exists before reading its properties. --- lib/output/markdown_ast.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/output/markdown_ast.js b/lib/output/markdown_ast.js index a4dfb09a9..c40132703 100644 --- a/lib/output/markdown_ast.js +++ b/lib/output/markdown_ast.js @@ -126,7 +126,7 @@ function commentsToAST(comments, opts, callback) { } function githubLink(comment) { - return comment.context.github && u('paragraph', [ + return comment.context && comment.context.github && u('paragraph', [ u('link', { title: 'Source code on GitHub', url: comment.context.github