lib/legion/extensions/tasker/runners/updater.rb in lex-tasker-0.1.3 vs lib/legion/extensions/tasker/runners/updater.rb in lex-tasker-0.2.0

- old
+ new

@@ -3,9 +3,15 @@ module Updater include Legion::Extensions::Helpers::Lex def update_status(task_id:, **opts) task = Legion::Data::Model::Task[task_id] + if task.nil? || task.values.nil? + return { success: false, changed: false, task_id: task_id, message: 'task nil' } + end + + log.unknown task.class + update_hash = {} %i[status function_args payload results].each do |column| next unless opts.key? column update_hash[column] = if opts[column].is_a? String