Permalink
Browse files

Handle functions without examples correctly in docgenerator

  • Loading branch information...
1 parent 715b83e commit e0095229ac840f92166248597d5bcf156b9fddb5 @josdejong committed Aug 15, 2016
Showing with 3 additions and 1 deletion.
  1. +3 −1 tools/docgenerator.js
@@ -183,7 +183,9 @@ function generateDoc(name, code) {
}
stripLeadingSpaces(doc.examples);
- if (doc.examples[doc.examples.length - 1].trim() == '') doc.examples.pop();
+ if (doc.examples.length > 0 && doc.examples[doc.examples.length - 1].trim() == '') {
+ doc.examples.pop();
+ }
skipEmptyLines();

0 comments on commit e009522

Please sign in to comment.