summaryrefslogtreecommitdiff
path: root/lib/rexml
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2019-02-09 20:33:06 +0000
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2019-08-04 11:54:50 +0900
commitee8985ef0e35183d606af3a7360cd4713069e9b2 (patch)
tree9d3f4ea01854683d3dd7faba42d1873070c3cba6 /lib/rexml
parent982208c65069423b1bc90dafde7589872c452c21 (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')
-rw-r--r--lib/rexml/functions.rb5
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