aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Weizenbaum <nex342@gmail.com>2010-08-07 23:41:34 -0700
committerNathan Weizenbaum <nex342@gmail.com>2010-08-07 23:41:34 -0700
commit93136d49b67539b703655ebae4561a7936df4e8e (patch)
tree36810bf8072c9ed15081a57872e9266d50ab93ee
parent69960638eeeccdfdf2409a639961b3fa3d8269f2 (diff)
Don't die when switch-to-buffer is passed nil.
-rw-r--r--perspective.el4
1 files changed, 3 insertions, 1 deletions
diff --git a/perspective.el b/perspective.el
index 21429d5..8e82594 100644
--- a/perspective.el
+++ b/perspective.el
@@ -546,7 +546,9 @@ is non-nil or with prefix arg, don't switch to the new perspective."
"Add BUFFER to the current perspective.
See also `persp-add-buffer'."
- (persp-add-buffer (ad-get-arg 0)))
+ (let ((buf (ad-get-arg 0)))
+ (when buf
+ (persp-add-buffer buf))))
(defadvice recursive-edit (around persp-preserve-for-recursive-edit)
"Preserve the current perspective when entering a recursive edit."