branch: externals/org commit 3e010d81dcabafcdd97199b8122491a74ad9cbed Author: Ihor Radchenko <yanta...@posteo.net> Commit: Ihor Radchenko <yanta...@posteo.net>
org-element-adopt-elements: Skip nil children * lisp/org-element.el (org-element-adopt-elements): Ignore nil children instead of throwing an error. Reported-by: alain.coch...@unistra.fr Link: https://orgmode.org/list/25445.34286.700495.260...@gargle.gargle.howl --- lisp/org-element.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/org-element.el b/lisp/org-element.el index 020ec59b0f..c389cce635 100644 --- a/lisp/org-element.el +++ b/lisp/org-element.el @@ -603,7 +603,8 @@ Return parent element." ;; Link every child to PARENT. If PARENT is nil, it is a secondary ;; string: parent is the list itself. (dolist (child children) - (org-element-put-property child :parent (or parent children))) + (when child + (org-element-put-property child :parent (or parent children)))) ;; Add CHILDREN at the end of PARENT contents. (when parent (apply #'org-element-set-contents