Skip to content

Commit

Permalink
Fix: Moving the last page item to the the trash causes a crash. (Word…
Browse files Browse the repository at this point in the history
…Press#65236)

co-authored-by: jorgefilipecosta <[email protected]>
Co-authored-by: Mamaduka <[email protected]>
Co-authored-by: jasmussen <[email protected]>
  • Loading branch information
4 people authored Sep 11, 2024
1 parent a15a93d commit 8a7df39
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/dataviews/src/dataviews-layouts/list/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,9 @@ export default function ViewList< Item >( props: ViewListProps< Item > ) {
data.length - 1,
Math.max( 0, targetIndex )
);
if ( ! data[ clampedIndex ] ) {
return;
}
const itemIdPrefix = generateCompositeItemIdPrefix(
data[ clampedIndex ]
);
Expand Down

0 comments on commit 8a7df39

Please sign in to comment.