Fix error "Trying to access array offset on value of type null"

Created on 9 August 2021, almost 3 years ago
Updated 7 December 2023, 7 months ago

Problem/Motivation

When saving videos under the dev branch, it generates the following error:

Notice: Trying to access array offset on value of type null in /var/www/docroot/modules/contrib/video_embed_tiktok/src/Plugin/video_embed_field/Provider/Tiktok.php on line 52

Steps to reproduce

Install module, setup video field to enable TikTok URL support, then try to save a TikTok video. Error appears.

Proposed resolution

Just switch the code to properly handle a class object instead of an array response. Eazy peazy.

Remaining tasks

None, I will attach a patch to this ticket.

User interface changes

None, enjoy the fix.

API changes

None

Data model changes

None

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇺🇸United States pthurmond Overland Park, KS

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