Skip to content

Commit

Permalink
Merge pull request #94 from rgregg/master
Browse files Browse the repository at this point in the history
Fix crash when a page contains no links
  • Loading branch information
rgregg committed Mar 1, 2016
2 parents fd6f0a5 + dd4980d commit 887ad9f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ApiDocs.Validation/DocFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -912,6 +912,14 @@ public bool ValidateNoBrokenLinks(bool includeWarnings, out ValidationError[] er

List<string> linkedPages = new List<string>();

// If there are no links in this document, just skip the validation.
if (this.MarkdownLinks == null)
{
errors = new ValidationError[0];
linkedDocFiles = new string[0];
return true;
}

var foundErrors = new List<ValidationError>();
foreach (var link in this.MarkdownLinks)
{
Expand Down

0 comments on commit 887ad9f

Please sign in to comment.