- Commit
- c50061bd0359ee1822b08a7c18ee4adf55d6fb1d
- Parent
- 01cb5c9563cc257e14a0093843d87621563d961f
- Author
- John MacFarlane <jgm@berkeley.edu>
- Date
iterator: handle NULL root.
My personal build of CMark ✏️
iterator: handle NULL root.
1 file changed, 3 insertions, 0 deletions
Status | File Name | N° Changes | Insertions | Deletions |
Modified | src/iterator.c | 3 | 3 | 0 |
diff --git 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;