Skip to content

Commit

Permalink
Handle mailchimp audience not returning a list id (#133)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanmitchell authored Sep 20, 2024
1 parent aa26077 commit fb92bbb
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/Fieldtypes/MailchimpAudience.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,14 @@ protected function toItemArray($id)
if (! $list = $this->callApi("lists/{$id}")) {
return [];
}


if (! $id = Arr::get($list, 'id')) {
return [];
}

return [
'id' => $list['id'],
'title' => $list['name'],
'id' => $id,
'title' => Arr::get($list, 'name'),
];
}
}

0 comments on commit fb92bbb

Please sign in to comment.