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

Avoids Fog::Compute::Joyent::Real#decode_time_attrs raising an exception when an empty string is returned as created or updated property

This commit is contained in:
Pablo Baños López 2013-05-14 11:35:02 +02:00
parent 2ef483c89e
commit 386e63855d

View file

@ -201,8 +201,8 @@ module Fog
def decode_time_attrs(obj)
if obj.kind_of?(Hash)
obj["created"] = Time.parse(obj["created"]) if obj["created"]
obj["updated"] = Time.parse(obj["updated"]) if obj["updated"]
obj["created"] = Time.parse(obj["created"]) unless obj["created"].nil? or obj["created"] == ''
obj["updated"] = Time.parse(obj["updated"]) unless obj["updated"].nil? or obj["updated"] == ''
elsif obj.kind_of?(Array)
obj.map do |o|
decode_time_attrs(o)