From f702e26a923758c59945d49a17d7a6599c63e16b Mon Sep 17 00:00:00 2001 From: Bilal Shafi Date: Mon, 9 Oct 2023 19:58:40 +0500 Subject: [PATCH] [DataGrid] Fix LazyLoading demo crash --- .../src/hooks/features/lazyLoader/useGridLazyLoader.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/grid/x-data-grid-pro/src/hooks/features/lazyLoader/useGridLazyLoader.ts b/packages/grid/x-data-grid-pro/src/hooks/features/lazyLoader/useGridLazyLoader.ts index d90e2f8ab160..6f19a0a3721f 100644 --- a/packages/grid/x-data-grid-pro/src/hooks/features/lazyLoader/useGridLazyLoader.ts +++ b/packages/grid/x-data-grid-pro/src/hooks/features/lazyLoader/useGridLazyLoader.ts @@ -36,9 +36,9 @@ function findSkeletonRowsSection({ while (!isSkeletonSectionFound && firstRowIndex < lastRowIndex) { const isStartingWithASkeletonRow = - apiRef.current.getRowNode(visibleRowsSection[startIndex].id)!.type === 'skeletonRow'; + apiRef.current.getRowNode(visibleRowsSection[startIndex].id)?.type === 'skeletonRow'; const isEndingWithASkeletonRow = - apiRef.current.getRowNode(visibleRowsSection[endIndex].id)!.type === 'skeletonRow'; + apiRef.current.getRowNode(visibleRowsSection[endIndex].id)?.type === 'skeletonRow'; if (isStartingWithASkeletonRow && isEndingWithASkeletonRow) { isSkeletonSectionFound = true;