diff options
author | Alyssa Ross <[email protected]> | 2019-02-09 20:33:06 +0000 |
---|---|---|
committer | Hiroshi SHIBATA <[email protected]> | 2019-08-04 11:54:50 +0900 |
commit | ee8985ef0e35183d606af3a7360cd4713069e9b2 (patch) | |
tree | 9d3f4ea01854683d3dd7faba42d1873070c3cba6 /lib/rexml/functions.rb | |
parent | 982208c65069423b1bc90dafde7589872c452c21 (diff) |
[ruby/rexml] Fix crash with nil XPath variables (#13)
Patch by Alyssa Ross. Thanks!!!
https://github.com/ruby/rexml/commit/2a53c54f58
Diffstat (limited to 'lib/rexml/functions.rb')
-rw-r--r-- | lib/rexml/functions.rb | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/rexml/functions.rb b/lib/rexml/functions.rb index 219f9c8db5..9c226d2cdf 100644 --- a/lib/rexml/functions.rb +++ b/lib/rexml/functions.rb @@ -135,8 +135,7 @@ module REXML # # An object of a type other than the four basic types is converted to a # string in a way that is dependent on that type. - def Functions::string( object=nil ) - object = @@context[:node] if object.nil? + def Functions::string( object=@@context[:node] ) if object.respond_to?(:node_type) case object.node_type when :attribute @@ -165,8 +164,6 @@ module REXML object.to_s end end - when nil - "" else object.to_s end |