mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
improve Pry::Hooks#hook_exists? method
This commit is contained in:
parent
c52f94079c
commit
e5ad6fc561
1 changed files with 1 additions and 1 deletions
|
@ -244,7 +244,7 @@ class Pry
|
|||
# @param [Symbol] hook_name Name of the hook.
|
||||
# @return [Boolean] Whether the hook by the name `hook_name`
|
||||
def hook_exists?(event_name, hook_name)
|
||||
!!@hooks[event_name].find { |name, _| name == hook_name }
|
||||
!!(@hooks[event_name] && @hooks[event_name].find { |name, _| name == hook_name })
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue