org-num: Fix bug in check for commented headlines

* lisp/org-num.el (org-num--skip-value): Handle empty headlines.

This happens when org-num-skip-commented is non-nil.  When creating
a new headline, often org-num--skip-value is invoked before any
headline text is created. This means that ‘title‘ is nil and the
string-match check breaks. Checking if title is non-nil fixes this.

TINYCHANGE
This commit is contained in:
Anders Johansson 2020-08-25 15:55:45 +02:00 committed by Nicolas Goaziou
parent cdfc404bed
commit 40474827ea
1 changed files with 1 additions and 0 deletions

View File

@ -254,6 +254,7 @@ otherwise."
org-footnote-section
(equal title org-footnote-section))
(and org-num-skip-commented
title
(let ((case-fold-search nil))
(string-match org-num--comment-re title))
t)