getContactLists() does not always return an Array

Created on 6 March 2023, almost 2 years ago
Updated 4 April 2023, over 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.71.5 2024