From 022fb84b942ea347b3ca72e619299993180f1b53 Mon Sep 17 00:00:00 2001 From: ranfdev Date: Sun, 23 Jul 2023 10:46:19 +0200 Subject: [PATCH] Fix panic in gio InputStream --- gio/src/input_stream.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gio/src/input_stream.rs b/gio/src/input_stream.rs index 194a52e38088..08b6c044423e 100644 --- a/gio/src/input_stream.rs +++ b/gio/src/input_stream.rs @@ -450,7 +450,9 @@ impl> InputStreamAsyncBufRead { } } Poll::Ready(Err((_, err))) => { - let kind = err.kind::().unwrap(); + let kind = err + .kind::() + .unwrap_or(crate::IOErrorEnum::Failed); self.state = State::Failed(kind); Poll::Ready(Err(io::Error::new(io::ErrorKind::from(kind), err))) }