Permalink
Browse files

Bugfix: be more explicit with checking against REXML::Element, as it …

…may not be loaded in a Nokogiri-only environment
  • Loading branch information...
rubyjedi committed Jun 19, 2010
1 parent d340f93 commit 4e78009ce7d107538761ec1722a063c75b767a05
Showing with 2 additions and 2 deletions.
  1. +1 −1 lib/soap/element.rb
  2. +1 −1 lib/soap/mapping/mapping.rb
View
@@ -104,7 +104,7 @@ def initialize(data = nil, is_fault = false)
if data
if data.respond_to?(:to_xmlpart)
data = SOAP::SOAPRawData.new(data)
- elsif defined?(::REXML) and data.is_a?(::REXML::Element)
+ elsif defined?(::REXML) and defined?(::REXML::Element) and data.is_a?(::REXML::Element)
data = SOAP::SOAPRawData.new(SOAP::SOAPREXMLElementWrap.new(data))
end
if data.respond_to?(:elename)
@@ -127,7 +127,7 @@ def self.fault2exception(fault, registry = nil)
def self._obj2soap(obj, registry, type = nil)
if obj.respond_to?(:to_xmlpart)
SOAPRawData.new(obj)
- elsif defined?(::REXML) and obj.is_a?(::REXML::Element)
+ elsif defined?(::REXML) and defined?(::REXML::Element) and obj.is_a?(::REXML::Element)
SOAPRawData.new(SOAPREXMLElementWrap.new(obj))
elsif referent = Thread.current[:SOAPMapping][:MarshalKey][obj.__id__] and
!Thread.current[:SOAPMapping][:NoReference]

0 comments on commit 4e78009

Please sign in to comment.