From: Mark Schmatz Date: 2009-01-29T03:17:29+09:00 Subject: [ruby-core:21643] [Bug #1069] wrap method in REXML::Formatters has nil problem if no line break exists in string Bug #1069: wrap method in REXML::Formatters has nil problem if no line break exists in string http://redmine.ruby-lang.org/issues/show/1069 Author: Mark Schmatz Status: Open, Priority: High Reproducible Version: 1.8-head In Ruby version 1.8.6 and 1.8.7 the following line of the wrap method of the REXML::Formatters class causes a bug when the place variable is nil: return string[0,place] + "\n" + wrap(string[place+1..-1], width) This is very obvious. The place variable is nil if there is no space (' ') found one line above: place = string.rindex(' ', width) # Position in string with last ' ' before cutoff For me, I fixed the bug with placing the following line in between: return string if place.nil? ---------------------------------------- http://redmine.ruby-lang.org