Check for nil before trying to replace a line

git-svn-id: file:///home/svn/framework3/trunk@7108 4d416f70-5f16-0410-b530-b9f4589650da
unstable
HD Moore 2009-10-01 16:47:48 +00:00
parent 92359fecc5
commit b4d6ba1170
1 changed files with 3 additions and 1 deletions

View File

@ -4184,7 +4184,9 @@ module RbReadline
# the location.
if (cxt.sflags & SF_FOUND)!=0
cxt.prev_line_found = cxt.lines[cxt.history_pos]
rl_replace_line(cxt.lines[cxt.history_pos], false)
if (cxt.prev_line_found)
rl_replace_line(cxt.lines[cxt.history_pos], false)
end
@rl_point = cxt.sline_index
cxt.last_found_line = cxt.history_pos
rl_display_search(cxt.search_string, (cxt.sflags & SF_REVERSE)!=0, (cxt.history_pos == cxt.save_line) ? -1 : cxt.history_pos)