diff --git a/actix-multipart/src/server.rs b/actix-multipart/src/server.rs index 9babe31a0..3d591ddfe 100644 --- a/actix-multipart/src/server.rs +++ b/actix-multipart/src/server.rs @@ -643,7 +643,7 @@ impl InnerField { return Poll::Ready(None); } - let result = if let Some(mut payload) = self.payload.as_ref().unwrap().get_mut(s) { + let result = if let Some(mut payload) = self.payload.as_ref().and_then(|p| p.get_mut(s)) { if !self.eof { let res = if let Some(ref mut len) = self.length { InnerField::read_len(&mut payload, len)