lib/onering/plugins/assets.rb in onering-client-0.2.1 vs lib/onering/plugins/assets.rb in onering-client-0.2.3

- old
+ new

@@ -6,10 +6,10 @@ end def get_field(id, field, fallback=nil) rv = get("/devices/#{id}/get/#{field}") rv = (rv.parsed_response rescue rv.response.body) - return fallback if rv.nil? or rv.strip.chomp.empty? + return fallback if rv.nil? or (rv.is_a?(String) and rv.strip.chomp.empty?) return rv end def set_field(id, field, value) rv = get("/devices/#{id}/set/#{field}/#{value}")