branch: master commit cdd7ada733bced5dd1c0bcd071b3195cf0b8b5b6 Author: Oleh Krehel <ohwoeo...@gmail.com> Commit: Oleh Krehel <ohwoeo...@gmail.com>
counsel.el (counsel-url-expand): Avoid null error --- counsel.el | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/counsel.el b/counsel.el index 1a6ab5b..6605d90 100644 --- a/counsel.el +++ b/counsel.el @@ -2114,15 +2114,16 @@ will be expanded according to its format. This function is intended to be used in `ivy-ffap-url-functions' to browse the result as a URL." (let ((word-at-point (current-word))) - (cl-some - (lambda (pair) - (let ((regexp (car pair)) - (formatter (cdr pair))) - (when (string-match regexp word-at-point) - (if (functionp formatter) - (funcall formatter word-at-point) - (format formatter word-at-point))))) - counsel-url-expansions-alist))) + (when word-at-point + (cl-some + (lambda (pair) + (let ((regexp (car pair)) + (formatter (cdr pair))) + (when (string-match regexp word-at-point) + (if (functionp formatter) + (funcall formatter word-at-point) + (format formatter word-at-point))))) + counsel-url-expansions-alist)))) ;;** `counsel-recentf' (defvar recentf-list)