Skip to content
This repository has been archived by the owner on Nov 20, 2018. It is now read-only.

Commit

Permalink
Merge 23e25c2 into 3b2f9ba
Browse files Browse the repository at this point in the history
  • Loading branch information
amedeiros committed Dec 16, 2014
2 parents 3b2f9ba + 23e25c2 commit f7a5199
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions aws-sdk-core/lib/aws-sdk-core/xml/parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
module Aws
module Xml
class Parser

# @param [Seahorse::Model::Shapes::Structure] shape
def initialize(shape)
@shape = shape
Expand All @@ -15,7 +14,10 @@ def initialize(shape)
# @param [Hash, nil] target
# @return [Structure]
def parse(xml, target = nil, &block)
xml = MultiXml.parse(xml).values.first || {}
parsed_xml = MultiXml.parse(xml)
xml = parsed_xml.values.first if parsed_xml && parsed_xml.values
xml ||= {}

yield(xml) if block_given?
structure(@shape, xml, target)
end
Expand Down Expand Up @@ -133,7 +135,6 @@ def timestamp(value)
def flat?(shape)
!!shape.metadata('flattened')
end

end
end
end

0 comments on commit f7a5199

Please sign in to comment.