branch: externals-release/org
commit 9c5867a78f8011417665bbc43192958ba77faad0
Author: Ihor Radchenko <yanta...@posteo.net>
Commit: Ihor Radchenko <yanta...@posteo.net>

    org-adaptive-fill-function: Do not err within blank lines at bob
    
    * lisp/org.el (org-adaptive-fill-function): Do not fail at the
    beginning of buffer, when point is within initial blank lines and
    `org-element-at-point' returns nil.
    
    Reported-by: Samuel Wales <samolog...@gmail.com>
    Link: 
https://orgmode.org/list/CAJcAo8vX_iHN=ouxtnw69420sz2bdk7wsjea7t3jymcgssq...@mail.gmail.com
---
 lisp/org.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org.el b/lisp/org.el
index 87563f50b2..dd2aba498d 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -20094,7 +20094,7 @@ matches in paragraphs or comments, use it."
                       (org-element-at-point)))
            (type (org-element-type element))
            (post-affiliated (org-element-post-affiliated element)))
-       (unless (< p post-affiliated)
+       (unless (or (not element) (< p post-affiliated))
         (cl-case type
           (comment
            (save-excursion

Reply via email to