mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-06 15:04:11 -04:00
refactor: dont panic if beacon_info is not found
This commit is contained in:
committed by
Jorge Martin Espinosa
parent
f336638a17
commit
aaecbf07f2
@@ -28,7 +28,7 @@ use ruma::{
|
||||
EventId, Int, OwnedDeviceId, OwnedUserId, RoomAliasId, UserId,
|
||||
};
|
||||
use tokio::sync::RwLock;
|
||||
use tracing::error;
|
||||
use tracing::{error, warn};
|
||||
|
||||
use super::RUNTIME;
|
||||
use crate::{
|
||||
@@ -1016,9 +1016,11 @@ impl Room {
|
||||
zoom_level: None,
|
||||
asset: None,
|
||||
};
|
||||
let beacon_info = event
|
||||
.beacon_info
|
||||
.expect("Live location share is missing the associated beacon_info state");
|
||||
|
||||
let Some(beacon_info) = event.beacon_info else {
|
||||
warn!("Live location share is missing the associated beacon_info state, skipping event.");
|
||||
continue;
|
||||
};
|
||||
|
||||
listener.call(vec![LiveLocationShare {
|
||||
last_location: LastLocation {
|
||||
|
||||
Reference in New Issue
Block a user