fix None/unwrap panic

This commit is contained in:
41666 2023-06-09 15:37:16 -04:00
parent 4d4ab3cde7
commit dd7eed2c9c

View file

@ -127,12 +127,13 @@ pub async fn get_world(
zone.alert = alert.cloned();
if zone.locked {
zone.locked_since = most_recent_alerts
zone.locked_since = match most_recent_alerts
.iter()
.find(|alert| alert.zone == zone.id)
.cloned()
.unwrap()
.end_time
{
Some(alert) => alert.end_time,
None => None,
};
}
zone