Make code more defensive

This commit is contained in:
Karol Manijak 2024-09-18 17:47:23 +08:00
parent 9ac5c20d5e
commit 6d7d3bf8fd
2 changed files with 4 additions and 4 deletions

View File

@ -876,9 +876,9 @@ class ProductCollection extends AbstractBlock {
// The post__in query needs special handling, as it should be an
// intersection of all post__in queries.
if (
is_array( $acc['post__in'] ) &&
is_array( $acc['post__in'] ?? null ) &&
! empty( $acc['post__in'] ) &&
is_array( $query['post__in'] ) &&
is_array( $query['post__in'] ?? null ) &&
! empty( $query['post__in'] )
) {
$result['post__in'] = array_intersect( $acc['post__in'], $query['post__in'] );

View File

@ -16058,7 +16058,7 @@ packages:
resolution: {integrity: sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==}
engines: {node: '>= 4.0'}
os: [darwin]
deprecated: The v1 package contains DANGEROUS / INSECURE binaries. Upgrade to safe fsevents v2
deprecated: Upgrade to fsevents v2 to mitigate potential security issues
fsevents@2.1.3:
resolution: {integrity: sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==}
@ -21807,7 +21807,7 @@ packages:
react-with-direction@1.4.0:
resolution: {integrity: sha512-ybHNPiAmaJpoWwugwqry9Hd1Irl2hnNXlo/2SXQBwbLn/jGMauMS2y9jw+ydyX5V9ICryCqObNSthNt5R94xpg==}
peerDependencies:
react: ^17.0.2
react: ^0.14 || ^15 || ^16
react-dom: ^0.14 || ^15 || ^16
react-with-styles-interface-css@4.0.3: