fix None/unwrap panic
This commit is contained in:
parent
4d4ab3cde7
commit
dd7eed2c9c
1 changed files with 5 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue