Skip to content
This repository has been archived by the owner on Dec 6, 2024. It is now read-only.

Commit

Permalink
fix: properly handle SC products with no active versions (#468)
Browse files Browse the repository at this point in the history
  • Loading branch information
carvantes authored Apr 28, 2021
1 parent 9b30e4e commit 3c561f4
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,10 @@ class EnvTypeCandidateService extends Service {
_.filter(paResult.ProvisioningArtifactDetails || [], pa => pa.Active), // filter out inactive versions
v => -1 * v.CreatedTime,
);
if (_.isEmpty(provisioningArtifacts)) {
// No active versions
return null;
}
const latestVersion = provisioningArtifacts[0];
latestVersion.isLatest = true;
provisioningArtifacts = versionFilterEnum.includeOnlyLatest(versionFilter)
Expand All @@ -220,7 +224,7 @@ class EnvTypeCandidateService extends Service {
);
}),
);
return productEnvTypes;
return _.filter(productEnvTypes, productEnvType => productEnvType !== null);
}

/**
Expand Down

0 comments on commit 3c561f4

Please sign in to comment.