diff --git a/src/ext/isearch.lisp b/src/ext/isearch.lisp index 9f210a6ac..f914137f3 100644 --- a/src/ext/isearch.lisp +++ b/src/ext/isearch.lisp @@ -312,13 +312,14 @@ (isearch-add-char char))) (defun isearch-end () - (isearch-reset-overlays (current-buffer)) - (change-previous-string *isearch-string*) - (buffer-unbound (current-buffer) 'isearch-redisplay-string) - (remove-hook (variable-value 'after-change-functions :buffer) - 'isearch-change-buffer-hook) - (isearch-mode nil) - t) + (when (boundp '*isearch-string) + (isearch-reset-overlays (current-buffer)) + (change-previous-string *isearch-string*) + (buffer-unbound (current-buffer) 'isearch-redisplay-string) + (remove-hook (variable-value 'after-change-functions :buffer) + 'isearch-change-buffer-hook) + (isearch-mode nil) + t)) (defun isearch-redisplay-inactive (buffer) (alexandria:when-let ((string (buffer-value buffer 'isearch-redisplay-string)))