Skip to content

Commit

Permalink
Prevent from crashing if no present
Browse files Browse the repository at this point in the history
  • Loading branch information
teclator committed Jul 3, 2018
1 parent a30e11f commit e6bad8a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions library/network/src/modules/NetworkInterfaces.rb
Expand Up @@ -893,8 +893,8 @@ def Write(devregex)
# look in OriginalDevs because we need to catch all variables
# of the alias

dev_aliases = original_devs[typ][dev]["_aliases"][anum] || {}
dev_aliases.keys.each do |key|
dev_aliases = original_devs.fetch(typ, {}).fetch(dev, {}).fetch("_aliases", {})
dev_aliases.fetch(anum, {}).keys.each do |key|
p = base + "#{key}_#{anum}"
log.debug("deleting: #{p}")
SCR.Write(p, nil)
Expand Down

0 comments on commit e6bad8a

Please sign in to comment.