diff --git a/app/controllers/reports/schedule_reports_controller.rb b/app/controllers/reports/schedule_reports_controller.rb index b46f6ba82..d7a0a6cf9 100644 --- a/app/controllers/reports/schedule_reports_controller.rb +++ b/app/controllers/reports/schedule_reports_controller.rb @@ -309,6 +309,8 @@ def session_removed_row(sheet, change) end def session_time_change_row(sheet, change) + return unless change[:recent] + orig_time = Time.parse(change[:changes]['start_time'][0]) if change[:changes]['start_time'][0] new_time = Time.parse(change[:changes]['start_time'][1]) if change[:changes]['start_time'][1] # Rails.logger.debug "********* #{change[:changes]['start_time'][1]} => #{new_time.class} #{new_time.strftime("%H")}" diff --git a/app/services/change_service.rb b/app/services/change_service.rb index 009733672..cdd2bc6a9 100644 --- a/app/services/change_service.rb +++ b/app/services/change_service.rb @@ -150,7 +150,7 @@ def self.combined_changes(item_audits:, type:, to:) # Get the old version of the object obj = if audit.event == 'create' # reify next just incase is has subsequently been deleted in a later pub and the find/exist will be nil - res = audit.next.reify + res = audit.next ? audit.next.reify : nil res ||= type.find(audit.item_id) if type.exists?(audit.item_id) res else