Skip to content

Commit 9bda56a

Browse files
committed
fix: in case redactBsConfig is called with null args, it throws exception
1 parent f6fcafd commit 9bda56a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

bin/helpers/usageReporting.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ function isUsageReportingEnabled() {
173173
}
174174

175175
function redactBsConfig(bsConfig) {
176-
if(typeof bsConfig === 'object' && !utils.isUndefined(bsConfig.run_settings)) {
176+
if(typeof bsConfig === 'object' && !utils.isUndefined(bsConfig) && !utils.isUndefined(bsConfig.run_settings)) {
177177
if(!utils.isUndefined(bsConfig.run_settings["projectId"])) { bsConfig.run_settings["projectId"] = REDACTED }
178178
if(!utils.isUndefined(bsConfig.run_settings["record-key"])) { bsConfig.run_settings["record-key"] = REDACTED }
179179
}
@@ -200,6 +200,7 @@ function redactKeys(str, regex, redact) {
200200
function send(args) {
201201
if (isUsageReportingEnabled() === "true") return;
202202

203+
// console.log(args)
203204
let bsConfig = JSON.parse(JSON.stringify(args.bstack_config));
204205
let runSettings = "";
205206
let sanitizedbsConfig = "";

0 commit comments

Comments
 (0)