From c446c1809f50990ea6f8b7b362ae92e519982230 Mon Sep 17 00:00:00 2001 From: shirady <57721533+shirady@users.noreply.github.com> Date: Thu, 21 Nov 2024 08:12:12 +0200 Subject: [PATCH] CR changes Signed-off-by: shirady <57721533+shirady@users.noreply.github.com> --- src/endpoint/s3/s3_bucket_logging.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/endpoint/s3/s3_bucket_logging.js b/src/endpoint/s3/s3_bucket_logging.js index 8922b096c5..6bdd543dae 100644 --- a/src/endpoint/s3/s3_bucket_logging.js +++ b/src/endpoint/s3/s3_bucket_logging.js @@ -20,12 +20,13 @@ async function send_bucket_op_logs(req, res) { //so we aggregate and issue the writes only in the end const writes_aggregate = []; - let bucket_info; // please notice bucket_info might be undefined + let bucket_info; try { bucket_info = await req.object_sdk.read_bucket_sdk_config_info(req.params.bucket); dbg.log2("read_bucket_sdk_config_info = ", bucket_info); } catch (err) { dbg.warn(`send_bucket_op_logs of bucket ${req.params.bucket} got an error:`, err); + return; } if (is_bucket_logging_enabled(bucket_info)) { @@ -33,7 +34,7 @@ async function send_bucket_op_logs(req, res) { endpoint_bucket_op_logs(req.op_name, req, res, bucket_info, writes_aggregate); } - if (req.notification_logger && bucket_info && bucket_info.notifications) { + if (req.notification_logger && bucket_info.notifications) { for (const notif_conf of bucket_info.notifications) { if (check_notif_relevant(notif_conf, req)) { const notif = compose_notification_req(req, res, bucket_info, notif_conf);