mirror of
https://codeberg.org/icewind/vbsp.git
synced 2026-06-03 18:54:05 +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,
|
source: &'static str,
|
||||||
target: &'static str,
|
target: &'static str,
|
||||||
) -> BspResult<()> {
|
) -> BspResult<()> {
|
||||||
let max = indexes.max().unwrap_or_default();
|
let max = match indexes.max() {
|
||||||
|
Some(max) => max,
|
||||||
|
None => return Ok(()),
|
||||||
|
};
|
||||||
max.try_into()
|
max.try_into()
|
||||||
.ok()
|
.ok()
|
||||||
.and_then(|index| list.get(index))
|
.and_then(|index| list.get(index))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue