TypeError on node page if source image is null

Created on 4 July 2023, over 1 year ago
Updated 16 July 2023, over 1 year ago

Hello team,

This wonderful module generates social media previews for my nodes (og:image). Previews are generated using the image field configured for my module. Some time ago this field was not mandatory for my content type so I have some nodes without images. I discovered that in this case 5xx error returns:
TypeError: Drupal\textimage\TextimageFactory::getTokenReplacement(): Argument #1 ($textimage) must be of type Drupal\textimage\TextimageInterface, null given

I prepared a trivial solution for this scenario and would much appreciate it if you review it and approve it it.

Thanks!

🐛 Bug report
Status

Needs review

Version

4.3

Component

Code

Created by

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

Comments & Activities

Production build 0.71.5 2024