We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent df3e1c9 commit 24077feCopy full SHA for 24077fe
src/dbgp/client.rs
@@ -308,12 +308,12 @@ impl DbgpClient {
308
debug!("[dbgp] >> {}", cmd_str);
309
let bytes = [cmd_str.trim_end(), "\0"].concat();
310
self.tid += 1;
311
- self.stream
312
- .as_mut()
313
- .unwrap()
314
- .write(bytes.as_bytes())
315
- .await
316
- .map_err(anyhow::Error::from)
+ match self.stream.as_mut() {
+ Some(stream) => stream.write(bytes.as_bytes())
+ .await
+ .map_err(anyhow::Error::from),
+ None => Err(anyhow::anyhow!("Stream was closed")),
+ }
317
}
318
319
pub(crate) async fn disonnect(&mut self) -> Result<(), anyhow::Error> {
0 commit comments