Skip to content

Commit

Permalink
Fix undefined method `size' for nil:NilClass in network_defined?
Browse files Browse the repository at this point in the history
  • Loading branch information
larstobi committed Jan 20, 2024
1 parent d5a28ae commit 7d8b5e4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion plugins/providers/docker/driver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,8 @@ def network_defined?(subnet_string)
network_info = inspect_network(all_networks)
network_info.each do |network|
config = network["IPAM"]["Config"]
if (config.size > 0 &&
if (defined?(config.size) &&
config.size > 0 &&
config.first["Subnet"] == subnet_string)
@logger.debug("Found existing network #{network["Name"]} already configured with #{subnet_string}")
return network["Name"]
Expand Down

0 comments on commit 7d8b5e4

Please sign in to comment.