1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

Add nil check on metadata mock

The default value for metadata is nil, and this was raising NoMethodError on each_pair.
This commit is contained in:
Mike Moore 2013-07-03 01:09:00 -06:00
parent dd10f93006
commit 9566d9b5f9

View file

@ -18,7 +18,7 @@ module Fog
requires :parent
metadata = service.list_metadata(collection_name, @parent.id).body['metadata']
metas = []
metadata.each_pair {|k,v| metas << {"key" => k, "value" => v} }
metadata.each_pair {|k,v| metas << {"key" => k, "value" => v} } unless metadata.nil?
load(metas)
end