From b4d6ba117033bd8bd841c5f0aa0e637fa204eaf8 Mon Sep 17 00:00:00 2001 From: HD Moore Date: Thu, 1 Oct 2009 16:47:48 +0000 Subject: [PATCH] Check for nil before trying to replace a line git-svn-id: file:///home/svn/framework3/trunk@7108 4d416f70-5f16-0410-b530-b9f4589650da --- lib/rbreadline.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/rbreadline.rb b/lib/rbreadline.rb index f8774c2b8d..2f849b8aaa 100644 --- a/lib/rbreadline.rb +++ b/lib/rbreadline.rb @@ -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)