diff options
author | Anton Aksola <anton.aksola@nebula.fi> | 2014-06-06 11:52:25 +0300 |
---|---|---|
committer | Anton Aksola <anton.aksola@nebula.fi> | 2014-06-06 11:52:25 +0300 |
commit | b893ec78e10de9d29fcfc62e1cf67d6a72c7dfd0 (patch) | |
tree | c8e6bf61ba8a634ec3226e977865cfe0f9ab50d6 /lib/oxidized/node.rb | |
parent | 7e6ecbdeb962ea0dda9ad75872aef05ca2760240 (diff) |
fix: node#last= didn't handle nil
temporary fix. Maybe node#last should check the type or we shouldn't use
last for the nodes#next in the first place
Diffstat (limited to 'lib/oxidized/node.rb')
-rw-r--r-- | lib/oxidized/node.rb | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/oxidized/node.rb b/lib/oxidized/node.rb index 0f4c525..20aab76 100644 --- a/lib/oxidized/node.rb +++ b/lib/oxidized/node.rb @@ -95,12 +95,16 @@ module Oxidized end def last= job - ostruct = OpenStruct.new - ostruct.start = job.start - ostruct.end = job.end - ostruct.status = job.status - ostruct.time = job.time - @last = ostruct + if job + ostruct = OpenStruct.new + ostruct.start = job.start + ostruct.end = job.end + ostruct.status = job.status + ostruct.time = job.time + @last = ostruct + else + @last = nil + end end def reset |