Skip to content

Commit 92f17bc

Browse files
authored
Merge branch 'release/3.7.0' into publish/3.7.0
2 parents c4cc9e8 + 07fd4cf commit 92f17bc

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

plugins/dominant-color-images/hooks.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -251,15 +251,18 @@ function dominant_color_admin_script(): void {
251251
*
252252
* @since 1.2.0
253253
*
254-
* @param array<mixed>|mixed $response The current response array for the attachment.
255-
* @param WP_Post $attachment The attachment post object.
256-
* @param array<mixed> $meta The attachment metadata.
257-
* @return array<mixed> The modified response array with added dominant color and transparency information.
254+
* @param array<string, mixed>|mixed $response The current response array for the attachment.
255+
* @param WP_Post $attachment The attachment post object.
256+
* @param array<string, mixed>|false $meta The attachment metadata.
257+
* @return array<string, mixed> The modified response array with added dominant color and transparency information.
258258
*/
259-
function dominant_color_prepare_attachment_for_js( $response, WP_Post $attachment, array $meta ): array {
259+
function dominant_color_prepare_attachment_for_js( $response, WP_Post $attachment, $meta ): array {
260260
if ( ! is_array( $response ) ) {
261261
$response = array();
262262
}
263+
if ( ! is_array( $meta ) ) {
264+
return $response;
265+
}
263266

264267
$response['dominantColor'] = '';
265268
if (

0 commit comments

Comments
 (0)