~10% of healthcheck runs failed with error "Cannot fine property length of undefned"

Summary: According to dashboard, ~10% of healthcheck runs failed with error "Cannot find property length of undefned". So here I'm fixing the only place where length property is used by doctor.

Reviewed By: passy

Differential Revision: D19470886

fbshipit-source-id: 3ad88370e5cb652c6f20034ebf5f38fadc46bf53
This commit is contained in:
Anton Nikolaev
2020-01-20 09:53:06 -08:00
committed by Facebook Github Bot
parent fd83a751c7
commit f94446310d
4 changed files with 10 additions and 7 deletions

View File

@@ -1,6 +1,6 @@
{ {
"name": "flipper-doctor", "name": "flipper-doctor",
"version": "0.6.0", "version": "0.6.1",
"description": "Utility for checking for issues with a flipper installation", "description": "Utility for checking for issues with a flipper installation",
"main": "lib/index.js", "main": "lib/index.js",
"types": "lib/index.d.ts", "types": "lib/index.d.ts",

View File

@@ -113,7 +113,10 @@ export function getHealthchecks(): Healthchecks {
label: 'SDK Installed', label: 'SDK Installed',
isRequired: true, isRequired: true,
run: async (e: EnvironmentInfo) => ({ run: async (e: EnvironmentInfo) => ({
hasProblem: e.SDKs['iOS SDK'].Platforms.length === 0, hasProblem:
!e.SDKs['iOS SDK'] ||
!e.SDKs['iOS SDK'].Platforms ||
!e.SDKs['iOS SDK'].Platforms.length,
}), }),
}, },
{ {

View File

@@ -140,7 +140,7 @@
"expand-tilde": "^2.0.2", "expand-tilde": "^2.0.2",
"express": "^4.15.2", "express": "^4.15.2",
"fb-watchman": "^2.0.0", "fb-watchman": "^2.0.0",
"flipper-doctor": "^0.6.0", "flipper-doctor": "^0.6.1",
"fs-extra": "^8.0.1", "fs-extra": "^8.0.1",
"immer": "^5.2.1", "immer": "^5.2.1",
"immutable": "^4.0.0-rc.12", "immutable": "^4.0.0-rc.12",

View File

@@ -4192,10 +4192,10 @@ flatted@^2.0.0:
resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.1.tgz#69e57caa8f0eacbc281d2e2cb458d46fdb449e08" resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.1.tgz#69e57caa8f0eacbc281d2e2cb458d46fdb449e08"
integrity sha512-a1hQMktqW9Nmqr5aktAux3JMNqaucxGcjtjWnZLHX7yyPCmlSV3M54nGYbqT8K+0GhF3NBgmJCc3ma+WOgX8Jg== integrity sha512-a1hQMktqW9Nmqr5aktAux3JMNqaucxGcjtjWnZLHX7yyPCmlSV3M54nGYbqT8K+0GhF3NBgmJCc3ma+WOgX8Jg==
flipper-doctor@^0.6.0: flipper-doctor@^0.6.1:
version "0.6.0" version "0.6.1"
resolved "https://registry.yarnpkg.com/flipper-doctor/-/flipper-doctor-0.6.0.tgz#850eaf5e2f7abfb6cb3db0a383f7aa09c35d8176" resolved "https://registry.yarnpkg.com/flipper-doctor/-/flipper-doctor-0.6.1.tgz#7a10cbe655293332c509d3ca37611bc32ee5d514"
integrity sha512-aUdsw2b+9oVs/5V3X1TGEETu5TdheriY18pt8PWbhhliln7mUv0dnpvdA02tLlLfHKQ0B07OUrHO/kFaFAfI9Q== integrity sha512-XRN5LqTK9J+2K5ixPwEODHYRyfL3hs9qDsKzcPoecoHP2DxPBOJNm2d2+J03lqFMedYE63a6+WhWUXOQoBRyEQ==
dependencies: dependencies:
"@types/node" "^12.12.12" "@types/node" "^12.12.12"
envinfo "^7.4.0" envinfo "^7.4.0"