Skip to content

Commit

Permalink
feat(objectarium): add check for pagination default_page_size cannot …
Browse files Browse the repository at this point in the history
…be zero
  • Loading branch information
bdeneux committed Jun 7, 2024
1 parent 79066d5 commit c993e22
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions contracts/axone-objectarium/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,10 @@ impl Pagination {
));
}

if default_page_size == 0 {
return Err(StdError::generic_err("'default_page_size' cannot be zero"));
}

if default_page_size > max_page_size {
return Err(StdError::generic_err(
"'default_page_size' cannot exceed 'max_page_size'",
Expand Down

0 comments on commit c993e22

Please sign in to comment.