added error handling for edge cases where there are no networks or ips

This commit is contained in:
Eugene Howe 2012-08-09 13:24:21 -04:00
parent b10d40a7c9
commit d86123c669
2 changed files with 2 additions and 0 deletions

View File

@ -11,6 +11,7 @@ module Fog
def all
data = connection.get_ip_addresses(href).body[:IpAddresses][:IpAddress]
data = data.nil? ? [] : data
load(data)
end

View File

@ -12,6 +12,7 @@ module Fog
def all
data = connection.get_networks(href).body
data = data[:Networks] ? data[:Networks][:Network] : data[:Network]
data = data.nil? ? [] : data
load(data)
end