handle possible null case for dep error

This commit is contained in:
Matt Hill
2021-09-30 22:01:16 -06:00
committed by Aiden McClelland
parent 8c6fab319a
commit eaafc764f5
3 changed files with 6 additions and 5 deletions

View File

@@ -33,15 +33,16 @@ function getDependencyStatus (pkg: PackageDataEntry): DependencyStatus {
const installed = pkg.installed
if (isEmptyObject(installed['current-dependencies'])) return null
const pkgIds = Object.keys(installed.status['dependency-errors'])
const depErrors = installed.status['dependency-errors']
const depIds = Object.keys(depErrors).filter(key => !!depErrors[key])
for (let pkgId of pkgIds) {
for (let pkgId of depIds) {
if (pkg.manifest.dependencies[pkgId].critical) {
return DependencyStatus.Critical
}
}
return pkgIds.length ? DependencyStatus.Issue : DependencyStatus.Satisfied
return depIds.length ? DependencyStatus.Issue : DependencyStatus.Satisfied
}
function getHealthStatus (status: Status): HealthStatus {