Skip to content

Commit

Permalink
Merge pull request #2638 from jonathannewman/maint/main/issue-2637
Browse files Browse the repository at this point in the history
(maint) ensure no nil dereference in find_in_interfaces
  • Loading branch information
joshcooper authored Nov 15, 2023
2 parents 44c49f6 + 32e1f28 commit c813235
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/facter/util/resolvers/networking/primary_interface.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ def read_from_ip_route
end

def find_in_interfaces(interfaces)
return if interfaces.nil?

interfaces.each do |iface_name, interface|
interface[:bindings]&.each do |binding|
return iface_name unless Facter::Util::Resolvers::Networking.ignored_ip_address(binding[:address])
Expand Down

0 comments on commit c813235

Please sign in to comment.