fix(dolist): don't fail on error when contact does not exist yet

This commit is contained in:
Colin Darie 2023-05-09 11:06:48 +02:00
parent 2b2d65de87
commit 049219a4a2
No known key found for this signature in database
GPG key ID: 4FB865FDBCA4BCC4

View file

@ -152,7 +152,11 @@ module Dolist
}
}.to_json
post(url, body)["FieldList"].find { _1['ID'] == 72 }['Value']
fields = post(url, body).fetch("FieldList", [])
return nil if fields.empty?
fields.find { _1['ID'] == 72 }.fetch('Value')
end
def ignorable_error?(response, mail)