Skip to content

Commit 1e2c5f6

Browse files
committed
If page metadata count is not set return 0.
1 parent 97119b9 commit 1e2c5f6

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

frontend/src/components/Public.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export const Public = (): JSX.Element => {
114114
</Grid>
115115
<Box display="flex" justifyContent="center" sx={{ m: 1 }}>
116116
<Pagination
117-
count={Math.ceil(pageMetadata.total_count / limit)}
117+
count={Math.ceil((pageMetadata?.total_count ?? 0) / limit)}
118118
page={currPageNum}
119119
onChange={handlePageChange}
120120
shape="rounded"

frontend/src/components/datasets/PublicDataset.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ export const PublicDataset = (): JSX.Element => {
281281
/>
282282
<Box display="flex" justifyContent="center" sx={{ m: 1 }}>
283283
<Pagination
284-
count={Math.ceil(pageMetadata.total_count / limit)}
284+
count={Math.ceil((pageMetadata.total_count ?? 0) / limit)}
285285
page={currPageNum}
286286
onChange={handlePageChange}
287287
shape="rounded"

0 commit comments

Comments
 (0)