Skip to content

Commit

Permalink
Fix nil error when Result has lines=nil for some reason
Browse files Browse the repository at this point in the history
I'm pretty sure this has something to do with the possibly dubious choice of nullifying several ivars in RunEmitter#complete, but hard to tell without a failing test case.

References #1
  • Loading branch information
brentd committed Nov 1, 2019
1 parent f128086 commit 6818722
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/nstance/result.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ def initialize(lines = [], status = nil, error: nil)
end

def inspect
log = "---\n" + lines.map { |(stream, msg)| "#{stream} | #{msg}" }.join + "---"
log = "---\n"
log += lines.map { |(stream, msg)| "#{stream} | #{msg}" }.join if lines
log += "---"
if error
log + " error: #{error.inspect}"
else
Expand Down

0 comments on commit 6818722

Please sign in to comment.