branch: elpa/inf-ruby
commit 91bbd7763dcad9370bf3567fbb012e83ceb8a681
Author: Steve Purcell <[email protected]>
Commit: Steve Purcell <[email protected]>
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