branch: externals/ivy commit 29b61fe1f4d5268d750b666a7ffc1269e22c6477 Author: Basil L. Contovounesios <conto...@tcd.ie> Commit: Basil L. Contovounesios <conto...@tcd.ie>
Guard against degenerate thing-at-point result * ivy.el (ivy-thing-at-point): Check that result of thing-at-point is usable. This works around https://bugs.gnu.org/58091. --- ivy.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ivy.el b/ivy.el index d7a23fed96..9b66dac917 100644 --- a/ivy.el +++ b/ivy.el @@ -433,7 +433,9 @@ the restoring themselves.") (end (region-end)) (eol (save-excursion (goto-char beg) (line-end-position)))) (buffer-substring-no-properties beg (min end eol)))) - ((thing-at-point 'url)) + ((let ((url (thing-at-point 'url))) + ;; Work around `https://bugs.gnu.org/58091'. + (and (stringp url) url))) ((and (eq (ivy-state-collection ivy-last) #'read-file-name-internal) (let ((inhibit-message t) (ffap-machine-p-known 'reject))