From 568b1dd332a75475efd6939b0ad73d7442f20d35 Mon Sep 17 00:00:00 2001 From: dpatanin Date: Wed, 11 Sep 2019 12:05:35 +0200 Subject: [PATCH] fix null to number exception --- src/wordpress_result_transformer.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wordpress_result_transformer.rb b/src/wordpress_result_transformer.rb index 39ff27d..10bc07e 100644 --- a/src/wordpress_result_transformer.rb +++ b/src/wordpress_result_transformer.rb @@ -25,8 +25,8 @@ def transform(r, timed_out: false) requests_done: r.dig('requests_done').to_s, db_update_finished: r.dig('db_update_finished').to_s, version: r.dig('version', 'number').to_s, - start_time: Time.at(r.dig('start_time')), - end_time: Time.at(r.dig('stop_time')) + start_time: r.dig('start_time').nil? ? nil : Time.at(r.dig('start_time')), + end_time: r.dig('stop_time').nil? ? nil : Time.at(r.dig('stop_time')) } } unless r.dig('version').nil? or r.dig('version').empty?