diff --git a/src/types/audio_player.rs b/src/types/audio_player.rs index f3924f4..238cd7b 100644 --- a/src/types/audio_player.rs +++ b/src/types/audio_player.rs @@ -95,7 +95,9 @@ impl AudioPlayer { sink.log_on_drop(false); self.stream_handle = Some(sink); } - Ok(self.stream_handle.as_ref().unwrap()) + self.stream_handle + .as_ref() + .ok_or_else(|| anyhow!("Failed to initialize stream_handle")) } fn drop_stream(&mut self) {