Browse Source

org-special-blocks.el: Prevent errors by first checking `org-line' is not nil.

* org-special-blocks.el
(org-special-blocks-convert-html-special-cookies): Prevent
errors by first checking `org-line' is not nil.

Thanks to Sébastien Vauban for reporting this.
Bastien Guerry 12 years ago
parent
commit
108fd10a27
1 changed files with 1 additions and 1 deletions
  1. 1 1
      lisp/org-special-blocks.el

+ 1 - 1
lisp/org-special-blocks.el

@@ -84,7 +84,7 @@ seen.  This is run after a few special cases are taken care of."
 (defun org-special-blocks-convert-html-special-cookies ()
   "Converts the special cookies into div blocks."
   ;; Uses the dynamically-bound variable `org-line'.
-  (when (string-match "^ORG-\\(.*\\)-\\(START\\|END\\)$" org-line)
+  (when (and org-line (string-match "^ORG-\\(.*\\)-\\(START\\|END\\)$" org-line))
     (message "%s" (match-string 1))
     (when (equal (match-string 2 org-line) "START")
       (org-close-par-maybe)