From 8b3cba8ae8fc0fcd0dcdd143995e9d78f0da1990 Mon Sep 17 00:00:00 2001 From: Miha Rekar Date: Sat, 23 Nov 2024 14:02:19 +0100 Subject: [PATCH] Guard for missing identity --- app/jobs/airtable_upload_all_job.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/jobs/airtable_upload_all_job.rb b/app/jobs/airtable_upload_all_job.rb index fb9aa478..bef5faa5 100644 --- a/app/jobs/airtable_upload_all_job.rb +++ b/app/jobs/airtable_upload_all_job.rb @@ -1,6 +1,8 @@ class AirtableUploadAllJob < AirtableJob def perform(user, shot_ids = nil) identity = user.identities.find_by(provider: "airtable") + return unless identity + if identity.valid_token? if user.coffee_management_enabled? Airtable::Roasters.new(user).upload_multiple(user.roasters.where(airtable_id: nil))