mirror of
https://codeberg.org/icewind/vbsp.git
synced 2026-06-03 10:44:07 +02:00
Merge pull request #4 from MinusGix/fix-validate-indexes
allow empty indexes
This commit is contained in:
commit
7331df6ad5
1 changed files with 4 additions and 1 deletions
|
|
@ -513,7 +513,10 @@ impl Bsp {
|
|||
source: &'static str,
|
||||
target: &'static str,
|
||||
) -> BspResult<()> {
|
||||
let max = indexes.max().unwrap_or_default();
|
||||
let max = match indexes.max() {
|
||||
Some(max) => max,
|
||||
None => return Ok(()),
|
||||
};
|
||||
max.try_into()
|
||||
.ok()
|
||||
.and_then(|index| list.get(index))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue