Skip to content
This repository was archived by the owner on Oct 22, 2020. It is now read-only.

Commit d1f34af

Browse files
committed
Prevent null reference if escape characters such as ^D are used
Fixes #35
1 parent a396dec commit d1f34af

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/cli/console.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,10 @@ def prompt_for_input
6464

6565
prompt += " [#{context.module_path}]" if context
6666
prompt += ' > '
67-
Readline.readline(prompt, true)
67+
68+
input = Readline.readline(prompt, true).to_s
69+
puts if input.empty?
70+
input
6871
end
6972

7073
def can_handle?(command)

0 commit comments

Comments
 (0)