Skip to content

Commit

Permalink
Fix an uninitialized instance variable warning in test
Browse files Browse the repository at this point in the history
  • Loading branch information
byroot committed Nov 18, 2022
1 parent cff5fc7 commit 0cbe7bf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/bootsnap/load_path_cache/change_observer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def self.register(arr, observer)
end

def self.unregister(arr)
return unless arr.instance_variable_get(:@lpc_observer)
return unless arr.instance_variable_defined?(:@lpc_observer) && arr.instance_variable_get(:@lpc_observer)

ArrayMixin.instance_methods.each do |method_name|
arr.singleton_class.send(:remove_method, method_name)
Expand Down

0 comments on commit 0cbe7bf

Please sign in to comment.