1
0
Fork 0
mirror of https://codeberg.org/icewind/vbsp.git synced 2026-06-03 18:54:05 +02:00

allow empty indexes

This commit is contained in:
MinusGix 2023-11-05 17:31:03 -06:00
commit d526228740

View file

@ -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))