emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master af5d2c1 097/348: Don't crash if default-directory is nil.


From: Oleh Krehel
Subject: [elpa] master af5d2c1 097/348: Don't crash if default-directory is nil.
Date: Sat, 8 Apr 2017 11:03:35 -0400 (EDT)

branch: master
commit af5d2c16d94368c2e424027a725eb28cdf8e49ea
Author: Wilfred Hughes <address@hidden>
Commit: Wilfred Hughes <address@hidden>

    Don't crash if default-directory is nil.
    
    I think this is a pretty rare occurrence (for some reason I had a
    `*Backtrace*` buffer with `default-directory` set to nil). However,
    `ivy-switch-buffer` would break in this situation.
---
 ivy.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/ivy.el b/ivy.el
index 96fe05c..c09ed4a 100644
--- a/ivy.el
+++ b/ivy.el
@@ -2731,8 +2731,9 @@ When VIRTUAL is non-nil, add virtual buffers."
     (mapcar
      (lambda (x)
        (if (with-current-buffer x
-             (file-remote-p
-              (abbreviate-file-name default-directory)))
+             (and default-directory
+                  (file-remote-p
+                   (abbreviate-file-name default-directory))))
            (propertize x 'face 'ivy-remote)
          (let ((face (with-current-buffer x
                        (cdr (assoc major-mode



reply via email to

[Prev in Thread] Current Thread [Next in Thread]