Skip to content

Commit

Permalink
fix panic
Browse files Browse the repository at this point in the history
  • Loading branch information
corwinkuiper committed Aug 30, 2024
1 parent 33b7ca3 commit 35f70d7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions dofus_set/src/dofus_set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,10 @@ impl State {
.filter_map(move |(set, number_of_items)| {
let set = &items[set];

set.bonuses[number_of_items as usize]
.as_ref()
set.bonuses
.get(number_of_items as usize)
.or_else(|| set.bonuses.last())
.and_then(|x| x.as_ref())
.map(|bonus| SetBonus {
name: &set.name,
bonus,
Expand Down

0 comments on commit 35f70d7

Please sign in to comment.