Skip to content

Commit

Permalink
Fix panic
Browse files Browse the repository at this point in the history
  • Loading branch information
ebc-2in2crc committed Jun 11, 2023
1 parent 52e61ef commit 93c4dcf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/percentile/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ func (c *CLI) Run() error {
return fmt.Errorf("failed scan file: %w", err)
}

if len(numbers) == 0 {
return nil
}

sort.Float64s(numbers)

for _, v := range opt.pValues {
Expand Down

0 comments on commit 93c4dcf

Please sign in to comment.