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