Skip to content

Commit

Permalink
📎 🐜 avoid crash on bad input
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleksei Matiushkin committed Jan 23, 2024
1 parent 024c30d commit 72513bb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ end
```

## Changelog
- **`0.13.3`**[:ant:] avoid crash on the incorrect input of slots
- **`0.13.2`**[:tada:] `Tempus.Slots.Stream.recurrent/3` to introduce cron-like streams
- **`0.13.0`**[:tada:] different calendars experimental support
- **`0.12.1`**[:tada:] timezones and more guards exported
Expand Down
5 changes: 4 additions & 1 deletion lib/tempus.ex
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,10 @@ defmodule Tempus do
{:halt, {collected, ms}}

slot, {collected, ms} ->
{:cont, {[slot | collected], ms + Slot.duration(slot, :microsecond)}}
case Slot.duration(slot, :microsecond) do
:infinity -> {:halt, {[slot | collected], ms}}
duration when is_integer(duration) -> {:cont, {[slot | collected], ms + duration}}
end
end)
|> elem(0)
|> Enum.reverse()
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ defmodule Tempus.MixProject do
use Mix.Project

@app :tempus
@version "0.13.2"
@version "0.13.3"

def project do
[
Expand Down

0 comments on commit 72513bb

Please sign in to comment.