From 45a9d96573e7f39eaa5ff2857f76cdf99ff7c920 Mon Sep 17 00:00:00 2001 From: Ivan Enderlin Date: Tue, 25 Nov 2025 14:41:38 +0100 Subject: [PATCH] chore(sdk): Remove an `unwrap` in `debug_string`. --- crates/matrix-sdk/src/event_cache/room/mod.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/crates/matrix-sdk/src/event_cache/room/mod.rs b/crates/matrix-sdk/src/event_cache/room/mod.rs index d509c445d..d06848326 100644 --- a/crates/matrix-sdk/src/event_cache/room/mod.rs +++ b/crates/matrix-sdk/src/event_cache/room/mod.rs @@ -418,7 +418,14 @@ impl RoomEventCache { /// Return a nice debug string (a vector of lines) for the linked chunk of /// events for this room. pub async fn debug_string(&self) -> Vec { - self.inner.state.read().await.unwrap().room_linked_chunk().debug_string() + match self.inner.state.read().await { + Ok(read_guard) => read_guard.room_linked_chunk().debug_string(), + Err(err) => { + warn!(?err, "Failed to obtain the read guard for the `RoomEventCache`"); + + vec![] + } + } } }