diff --git a/index.js b/index.js index 45002744..3684cdd6 100644 --- a/index.js +++ b/index.js @@ -382,13 +382,13 @@ function fastifyMultipart (fastify, options, done) { function onEnd (err) { cleanup(err) - ch(err || lastError) + ch(null) } function cleanup (err) { request.unpipe(bb) - if (err && currentFile) { + if ((err || request.aborted) && currentFile) { currentFile.destroy() }