From aaecbf07f299d6540395354022de90ba4fa7a429 Mon Sep 17 00:00:00 2001 From: torrybr <16907963+torrybr@users.noreply.github.com> Date: Fri, 24 Jan 2025 07:37:45 -0500 Subject: [PATCH] refactor: dont panic if beacon_info is not found --- bindings/matrix-sdk-ffi/src/room.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/bindings/matrix-sdk-ffi/src/room.rs b/bindings/matrix-sdk-ffi/src/room.rs index 757c43be3..818ac3ff3 100644 --- a/bindings/matrix-sdk-ffi/src/room.rs +++ b/bindings/matrix-sdk-ffi/src/room.rs @@ -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 {