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

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

[nongnu] elpa/inf-ruby 91bbd7763d 071/265: Avoid error when trying to sw


From: ELPA Syncer
Subject: [nongnu] elpa/inf-ruby 91bbd7763d 071/265: Avoid error when trying to switch to non-existing inf-ruby buffer
Date: Sat, 9 Jul 2022 21:59:15 -0400 (EDT)

branch: elpa/inf-ruby
commit 91bbd7763dcad9370bf3567fbb012e83ceb8a681
Author: Steve Purcell <steve@sanityinc.com>
Commit: Steve Purcell <steve@sanityinc.com>

    Avoid error when trying to switch to non-existing inf-ruby buffer
    
    Running `ruby-switch-to-inf` when there is no `inf-ruby-buffer` produces a 
hard error due to passing `nil` to `get-buffer`. This commit makes the handling 
of this case more robust.
---
 inf-ruby.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/inf-ruby.el b/inf-ruby.el
index 15b5795c65..54a5c9b489 100755
--- a/inf-ruby.el
+++ b/inf-ruby.el
@@ -321,7 +321,7 @@ Must not contain ruby meta characters.")
   "Switch to the ruby process buffer.
 With argument, positions cursor at end of buffer."
   (interactive "P")
-  (if (get-buffer inf-ruby-buffer)
+  (if (and inf-ruby-buffer (get-buffer inf-ruby-buffer))
       (pop-to-buffer inf-ruby-buffer)
     (error "No current process buffer. See variable inf-ruby-buffer."))
   (cond (eob-p



reply via email to

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