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:
parent
dd10f93006
commit
9566d9b5f9
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue