From c50061bd0359ee1822b08a7c18ee4adf55d6fb1d Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 17 Jan 2016 21:41:11 -0800 Subject: iterator: handle NULL root. --- src/iterator.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/iterator.c b/src/iterator.c index c477f01..351b81f 100644 --- a/src/iterator.c +++ b/src/iterator.c @@ -89,6 +89,9 @@ cmark_event_type cmark_iter_get_event_type(cmark_iter *iter) { cmark_node *cmark_iter_get_root(cmark_iter *iter) { return iter->root; } void cmark_consolidate_text_nodes(cmark_node *root) { + if (root == NULL) { + return; + } cmark_iter *iter = cmark_iter_new(root); cmark_strbuf buf = GH_BUF_INIT; cmark_event_type ev_type; -- cgit v1.2.3