]> git.eshelyaron.com Git - emacs.git/commitdiff
(find-buffer-visiting): Don't compare NUMBER if it is nil.
authorRichard M. Stallman <rms@gnu.org>
Thu, 10 Mar 1994 17:23:56 +0000 (17:23 +0000)
committerRichard M. Stallman <rms@gnu.org>
Thu, 10 Mar 1994 17:23:56 +0000 (17:23 +0000)
lisp/files.el

index 1eac656f8b774cc38ea7e5ed5d3d5a5a83f21097..8f33ee8d975b0cfa9bffe24c32e1cddd8eae4a94 100644 (file)
@@ -592,17 +592,18 @@ If there is no such live buffer, return nil."
          found)
        (let ((number (nthcdr 10 (file-attributes truename)))
              (list (buffer-list)) found)
-         (while (and (not found) list)
-           (save-excursion
-             (set-buffer (car list))
-             (if (and (equal buffer-file-number number)
-                      ;; Verify this buffer's file number
-                      ;; still belongs to its file.
-                      (file-exists-p buffer-file-name)
-                      (equal (nthcdr 10 (file-attributes buffer-file-name))
-                             number))
-                 (setq found (car list))))
-           (setq list (cdr list)))
+         (and number
+              (while (and (not found) list)
+                (save-excursion
+                  (set-buffer (car list))
+                  (if (and (equal buffer-file-number number)
+                           ;; Verify this buffer's file number
+                           ;; still belongs to its file.
+                           (file-exists-p buffer-file-name)
+                           (equal (nthcdr 10 (file-attributes buffer-file-name))
+                                  number))
+                      (setq found (car list))))
+                (setq list (cdr list))))
          found))))
 
 (defun find-file-noselect (filename &optional nowarn)