From cae3cccfe7589c4b7bbe0e7672501c4bf8b53e54 Mon Sep 17 00:00:00 2001 From: Prakash Senthil Vel <23444145+prakashsvmx@users.noreply.github.com> Date: Sat, 27 Aug 2022 11:22:35 +0530 Subject: [PATCH] return to avoid multiple callbacks by async (#1062) --- src/main/minio.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/minio.js b/src/main/minio.js index 70c9abc9..2dd7f83f 100644 --- a/src/main/minio.js +++ b/src/main/minio.js @@ -641,10 +641,10 @@ export class Client { // Retry with region returned as part of error this.makeRequest({method, bucketName, headers}, payload, [200], err.region, false, cb) } else { - cb && cb(err) + return cb && cb(err) } } - cb && cb(err) + return cb && cb(err) } this.makeRequest({method, bucketName, headers}, payload, [200], region, false, processWithRetry) }