Skip to content

Commit

Permalink
continue only if itemid is undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
ntsekouras committed Nov 6, 2023
1 parent d380508 commit 4d77693
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/core-data/src/queried-data/selectors.js
Expand Up @@ -52,10 +52,12 @@ function getQueriedItemsUncached( state, query ) {
if ( Array.isArray( include ) && ! include.includes( itemId ) ) {
continue;
}

if ( itemId === undefined ) {
continue;
}
// Having a target item ID doesn't guarantee that this object has been queried.
if ( ! state.items[ context ]?.hasOwnProperty( itemId ) ) {
continue;
return null;
}

const item = state.items[ context ][ itemId ];
Expand Down

0 comments on commit 4d77693

Please sign in to comment.