mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
ensure idx isnt nil here
This commit is contained in:
parent
9f354b9385
commit
2ece8f8f43
1 changed files with 1 additions and 1 deletions
|
@ -54,7 +54,7 @@ class Pry
|
|||
# @return [Pry] The parent of the current Pry session.
|
||||
def parent
|
||||
idx = Pry.sessions.index(self)
|
||||
Pry.sessions[idx - 1] if idx > 0
|
||||
Pry.sessions[idx - 1] if idx && idx > 0
|
||||
end
|
||||
|
||||
# Execute the hook `hook_name`, if it is defined.
|
||||
|
|
Loading…
Reference in a new issue