Fix undefined environment

This commit is contained in:
David Verdeguer 2021-05-05 15:07:47 +02:00
parent a1176686f1
commit 0c0bc0e6c6
3 changed files with 3 additions and 3 deletions

2
lib/actions-util.js generated
View file

@ -363,7 +363,7 @@ exports.getAutomationID = getAutomationID;
function computeAutomationID(analysis_key, environment) {
let automationID = `${analysis_key}/`;
// the id has to be deterministic so we sort the fields
if (environment) {
if (environment !== undefined && environment !== "null") {
const environmentObject = JSON.parse(environment);
for (const entry of Object.entries(environmentObject).sort()) {
if (typeof entry[1] === "string") {

File diff suppressed because one or more lines are too long

View file

@ -439,7 +439,7 @@ export function computeAutomationID(
let automationID = `${analysis_key}/`;
// the id has to be deterministic so we sort the fields
if (environment) {
if (environment !== undefined && environment !== "null") {
const environmentObject = JSON.parse(environment);
for (const entry of Object.entries(environmentObject).sort()) {
if (typeof entry[1] === "string") {