Skip to content

Commit

Permalink
only call #process_type if we have a type
Browse files Browse the repository at this point in the history
  • Loading branch information
rubiii committed Apr 30, 2013
1 parent ddbae8f commit 9d190ed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/wasabi/parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ def parse_types

case node.name
when 'element'
process_type namespace, node.at_xpath('./xs:complexType', 'xs' => XSD), node['name'].to_s
complex_type = node.at_xpath('./xs:complexType', 'xs' => XSD)
process_type namespace, complex_type, node['name'].to_s if complex_type
when 'complexType'
process_type namespace, node, node['name'].to_s
end
Expand All @@ -154,7 +155,6 @@ def parse_types
end

def process_type(namespace, type, name)
return unless type
@types[name] ||= { :namespace => namespace }

type.xpath("./xs:sequence/xs:element", 'xs' => XSD).
Expand Down

0 comments on commit 9d190ed

Please sign in to comment.