Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Use maybe

dominik-zeglendbd3ca02cd16
diff --git a/saleor/static/dashboard-next/products/views/ProductList/ProductList.tsx b/saleor/static/dashboard-next/products/views/ProductList/ProductList.tsx
index 43b39ca6db..8ef1de90a8 100644
--- a/saleor/static/dashboard-next/products/views/ProductList/ProductList.tsx
+++ b/saleor/static/dashboard-next/products/views/ProductList/ProductList.tsx
@@ -203,13 +203,9 @@ export const ProductList: React.StatelessComponent<ProductListProps> = ({
)}
onAdd={() => navigate(productAddUrl)}
disabled={loading}
- products={
- data &&
- data.products !== undefined &&
- data.products !== null
- ? data.products.edges.map(p => p.node)
- : undefined
- }
+ products={maybe(() =>
+ data.products.edges.map(edge => edge.node)
+ )}
onNextPage={loadNextPage}
onPreviousPage={loadPreviousPage}
pageInfo={pageInfo}