forked from osbuild/image-builder
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal/v1: correctly deal with offsets in GetPackages
If the offset was 0, which is the default, and if no packages were found, it panicked due to an out of bounds index. The reasoning by subtracting one was that even if you chose too large of an offset, it would still give you back something. Simply cap the offset in case it's larger than the amount of packages. The data returned will be empty but that's ok. Cap the offset in the "last" link at 0 if no results were found. The offset in the "first" link should always be 0.
- Loading branch information
1 parent
e337259
commit ff80916
Showing
2 changed files
with
26 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters