lib/tty/command/exit_error.rb in tty-command-0.4.0 vs lib/tty/command/exit_error.rb in tty-command-0.5.0

- old
+ new

@@ -18,11 +18,11 @@ def info(cmd_name, result) message = '' message << "Running `#{cmd_name}` failed with\n" message << " exit status: #{result.exit_status}\n" - message << " stdout: #{result.out.strip.empty? ? 'Nothing written' : result.out.strip}\n" - message << " stderr: #{result.err.strip.empty? ? 'Nothing written' : result.err.strip}\n" + message << " stdout: #{(result.out || '').strip.empty? ? 'Nothing written' : result.out.strip}\n" + message << " stderr: #{(result.err || '').strip.empty? ? 'Nothing written' : result.err.strip}\n" end end # ExitError end # Command end # TTY