From cd4188fd5c28520d39708cbdaf492e4f213aea60 Mon Sep 17 00:00:00 2001 From: Andrew Cherniavskyi Date: Mon, 2 Dec 2024 13:40:35 +0100 Subject: [PATCH] fix tests --- .../features/rowPinning/useGridRowPinningPreProcessors.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/x-data-grid-pro/src/hooks/features/rowPinning/useGridRowPinningPreProcessors.ts b/packages/x-data-grid-pro/src/hooks/features/rowPinning/useGridRowPinningPreProcessors.ts index c058cc45115c..586e4f2f4f4a 100644 --- a/packages/x-data-grid-pro/src/hooks/features/rowPinning/useGridRowPinningPreProcessors.ts +++ b/packages/x-data-grid-pro/src/hooks/features/rowPinning/useGridRowPinningPreProcessors.ts @@ -111,7 +111,8 @@ export const useGridRowPinningPreProcessors = ( if (prevPinnedRowsCache) { const pinnedRowCleanup = (rowId: GridRowId) => { - if (newGroupingParams.tree[rowId].type === 'pinnedRow') { + const node = newGroupingParams.tree[rowId]; + if (node?.type === 'pinnedRow') { delete newGroupingParams.tree[rowId]; delete newGroupingParams.dataRowIdToModelLookup[rowId]; delete newGroupingParams.dataRowIdToIdLookup[rowId];