diff --git a/lib/src/model/documentation.dart b/lib/src/model/documentation.dart index 8344fddd52..41c72b1eda 100644 --- a/lib/src/model/documentation.dart +++ b/lib/src/model/documentation.dart @@ -65,6 +65,9 @@ class Documentation { /// Returns a tuple of List and hasExtendedDocs Tuple2, bool> _parseDocumentation(bool processFullDocs) { + if (!_element.hasDocumentation) { + return Tuple2([], false); + } String text = _element.documentation; showWarningsForGenericsOutsideSquareBracketsBlocks(text, _element); MarkdownDocument document = diff --git a/lib/src/render/documentation_renderer.dart b/lib/src/render/documentation_renderer.dart index 44466ea426..a2ddcc7234 100644 --- a/lib/src/render/documentation_renderer.dart +++ b/lib/src/render/documentation_renderer.dart @@ -13,6 +13,9 @@ abstract class DocumentationRenderer { class DocumentationRendererHtml extends DocumentationRenderer { @override Tuple2 render(List nodes, bool processFullDocs) { + if (nodes.isEmpty) { + return Tuple2('', ''); + } var rawHtml = md.HtmlRenderer().render(nodes); var asHtmlDocument = parse(rawHtml); for (var s in asHtmlDocument.querySelectorAll('script')) {