summaryrefslogtreecommitdiff
path: root/lib/oxidized
diff options
context:
space:
mode:
authorAnton Aksola <anton.aksola@nebula.fi>2014-06-06 11:52:25 +0300
committerAnton Aksola <anton.aksola@nebula.fi>2014-06-06 11:52:25 +0300
commitb893ec78e10de9d29fcfc62e1cf67d6a72c7dfd0 (patch)
treec8e6bf61ba8a634ec3226e977865cfe0f9ab50d6 /lib/oxidized
parent7e6ecbdeb962ea0dda9ad75872aef05ca2760240 (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')
-rw-r--r--lib/oxidized/node.rb16
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