getContactLists() does not always return an Array

Created on 6 March 2023, over 1 year ago
Updated 4 April 2023, about 1 year ago

Problem/Motivation

When a request exception happens during a call to getContactLists() there is the possibility that nothing is returned instead of an array as expected. This causes the following PHP warning:

Warning: foreach() argument must be of type array|object, null given in Drupal\ik_constant_contact\Service\ConstantContact->getEnabledContactLists() (line 709 of modules/contrib/ik_constant_contact/src/Service/ConstantContact.php)

Steps to reproduce

Difficult to reproduce, but any network error when making the request should work.

Proposed resolution

Ensure the function always returns an array.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Fixed

Version

3.1

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States Daniel Korte Brooklyn, NY

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024