From 6c17e3bc3a896b877759fa93e4b4cfa1100d4743 Mon Sep 17 00:00:00 2001 From: Muneeb Shaikh Date: Fri, 11 Mar 2016 17:00:13 +0530 Subject: [PATCH] fix #5448: guard nil buffer size --- layers/+distribution/spacemacs-base/funcs.el | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/layers/+distribution/spacemacs-base/funcs.el b/layers/+distribution/spacemacs-base/funcs.el index 9afee3dec..3b9adf9d8 100644 --- a/layers/+distribution/spacemacs-base/funcs.el +++ b/layers/+distribution/spacemacs-base/funcs.el @@ -329,12 +329,12 @@ argument takes the kindows rotate backwards." ;; check when opening large files - literal file open (defun spacemacs/check-large-file () - (when (> (nth 7 (file-attributes (buffer-file-name))) - (* 1024 1024 dotspacemacs-large-file-size)) - (when (y-or-n-p "This is a large file, open literally to avoid performance issues?") - (setq buffer-read-only t) - (buffer-disable-undo) - (fundamental-mode)))) + (let ((size (nth 7 (file-attributes (buffer-file-name))))) + (when (and size (> size (* 1024 1024 dotspacemacs-large-file-size))) + (when (y-or-n-p "This is a large file, open literally to avoid performance issues?") + (setq buffer-read-only t) + (buffer-disable-undo) + (fundamental-mode))))) ;; found at http://emacswiki.org/emacs/KillingBuffers (defun spacemacs/kill-other-buffers ()