Ensure children isn't null before accepting (dart-lang/markdown#182)
diff --git a/pkgs/markdown/CHANGELOG.md b/pkgs/markdown/CHANGELOG.md index 56392e5..b4b93de 100644 --- a/pkgs/markdown/CHANGELOG.md +++ b/pkgs/markdown/CHANGELOG.md
@@ -1,5 +1,6 @@ ## 1.0.0 +* Fix issue where `accept` could cause an exception. * Remove deprecated `escapeHtml` function. * Fix compliance with auto-links, including support for email addresses. * Updated `ExtensionSet.gitHub` to more closely align with GitHub markdown.
diff --git a/pkgs/markdown/lib/src/ast.dart b/pkgs/markdown/lib/src/ast.dart index 12a79cc..9e4869e 100644 --- a/pkgs/markdown/lib/src/ast.dart +++ b/pkgs/markdown/lib/src/ast.dart
@@ -43,7 +43,9 @@ void accept(NodeVisitor visitor) { if (visitor.visitElementBefore(this)) { - for (var child in children) child.accept(visitor); + if (children != null) { + for (var child in children) child.accept(visitor); + } visitor.visitElementAfter(this); } }