Skip to content

Commit

Permalink
try fixing the error
Browse files Browse the repository at this point in the history
  • Loading branch information
gurgunday committed Feb 7, 2024
1 parent d9b55d5 commit 3eeb151
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}

Expand Down

0 comments on commit 3eeb151

Please sign in to comment.