lib/xeroizer/http.rb in xeroizer-2.15.1 vs lib/xeroizer/http.rb in xeroizer-2.15.2

- old
+ new

@@ -134,10 +134,10 @@ # raw_response.gsub! '<?xml version="1.0" encoding="utf-16"?>', '' # doc = REXML::Document.new(raw_response, :ignore_whitespace_nodes => :all) doc = Nokogiri::XML(raw_response) - if doc.root.name == "ApiException" + if doc && doc.root && doc.root.name == "ApiException" raise ApiException.new(doc.root.xpath("Type").text, doc.root.xpath("Message").text, raw_response, request_body)