From 5d02673130aa1a358bc578b4039b3becba059882 Mon Sep 17 00:00:00 2001 From: Ruel Tmeizeh - RuhNet Date: Fri, 5 Sep 2025 23:42:44 -0400 Subject: [PATCH] Fixed empty region value on custom_s3 --- app.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/app.js b/app.js index 7d238f1..098e745 100644 --- a/app.js +++ b/app.js @@ -212,13 +212,17 @@ console.log(self.storages); var attachments = storageData.attachments; for(var i in attachments) if(attachments.hasOwnProperty(i)) { var thisItem = attachments[i]; - var settings = thisItem.settings; - if (thisItem.settings && thisItem.settings.port) { - thisItem.settings.port = Number(thisItem.settings.port); - } else { - thisItem.settings.port = 443; - if (type == "couchdb") thisItem.settings.port = 5984; + var settings = {}; + if (thisItem.settings) { + settings = _.omitBy(thisItem.settings, _.isEmpty); //filter out empty values + if (settings.port) { + settings.port = Number(settings.port); + } else { + settings.port = 443; + if (type == "couchdb") settings.port = 5984; + } } + thisItem.settings = settings; attachments[i] = thisItem; }; storageData.attachments = attachments;