Skip to content

Commit

Permalink
fix: Ensure that the arg of goto-char is non-nil
Browse files Browse the repository at this point in the history
Fixes error: (wrong-type-argument integer-or-marker-p nil) when trying
to export with point not inside any valid post subtree.
  • Loading branch information
kaushalmodi committed Mar 18, 2022
1 parent 76d77f7 commit a121603
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ox-hugo.el
Expand Up @@ -4280,8 +4280,10 @@ the heading of that subtree.
Return nil if a valid Hugo post subtree is not found. The point
will be moved in this case too."
(let ((subtree (car (org-hugo--get-elem-with-prop :EXPORT_FILE_NAME))))
(goto-char (org-element-property :begin subtree))
(let* ((subtree (car (org-hugo--get-elem-with-prop :EXPORT_FILE_NAME)))
(point (org-element-property :begin subtree))) ;`point' will be nil if `subtree' is nil
(when point
(goto-char point))
subtree))

(defun org-hugo--get-post-subtree-coordinates (subtree)
Expand Down

0 comments on commit a121603

Please sign in to comment.