Ensure children isn't null before accepting (#182)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 56392e5..b4b93de 100644
--- a/CHANGELOG.md
+++ b/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/lib/src/ast.dart b/lib/src/ast.dart
index 12a79cc..9e4869e 100644
--- a/lib/src/ast.dart
+++ b/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);
     }
   }