Skip to content

Commit a2f03c7

Browse files
authored
Merge pull request #292 from HRanjan-11/CYP-905
fix undefined error when lambda auth is not present in config file
2 parents 1d14640 + c0ee3e9 commit a2f03c7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

commands/utils/set_args.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ function sync_args_from_cmd(args) {
111111
}
112112
lt_config["lambdatest_auth"]["username"] = process.env.LT_USERNAME;
113113
} else if ("username" in args && args["username"] != "") {
114+
if (!lt_config["lambdatest_auth"]) {
115+
lt_config["lambdatest_auth"] = {};
116+
}
114117
lt_config["lambdatest_auth"]["username"] = args["username"];
115118
}
116119

@@ -143,6 +146,9 @@ function sync_args_from_cmd(args) {
143146
console.log("Setting access key from environment");
144147
lt_config["lambdatest_auth"]["access_key"] = process.env.LT_ACCESS_KEY;
145148
} else if ("access_key" in args && args["access_key"] != "") {
149+
if (!lt_config["lambdatest_auth"]) {
150+
lt_config["lambdatest_auth"] = {};
151+
}
146152
lt_config["lambdatest_auth"]["access_key"] = args["access_key"];
147153
}
148154

0 commit comments

Comments
 (0)