Check if null before counting array

Created on 1 November 2023, 10 months ago
Updated 9 November 2023, 10 months ago

Problem/Motivation

I ported file_resup β†’ to D10+ and it has been working pretty good in production, but occasionally we get this error.

TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in count() (line 207 of core/modules/media_library/src/Form/FileUploadForm.php)

Proposed resolution

Can we add an empty check in that condition before counting please?

πŸ› Bug report
Status

Closed: won't fix

Version

10.1 ✨

Component
MediaΒ  β†’

Last updated 1 minute ago

Created by

πŸ‡ΊπŸ‡ΈUnited States Tim Bozeman

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024