From f94446310dac0773149f4785be2a57ad92dcd06d Mon Sep 17 00:00:00 2001 From: Anton Nikolaev Date: Mon, 20 Jan 2020 09:53:06 -0800 Subject: [PATCH] ~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 --- doctor/package.json | 2 +- doctor/src/index.ts | 5 ++++- package.json | 2 +- yarn.lock | 8 ++++---- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/doctor/package.json b/doctor/package.json index 2aba3fdd4..d97d1119e 100644 --- a/doctor/package.json +++ b/doctor/package.json @@ -1,6 +1,6 @@ { "name": "flipper-doctor", - "version": "0.6.0", + "version": "0.6.1", "description": "Utility for checking for issues with a flipper installation", "main": "lib/index.js", "types": "lib/index.d.ts", diff --git a/doctor/src/index.ts b/doctor/src/index.ts index 9fbb844dd..19ac3b415 100644 --- a/doctor/src/index.ts +++ b/doctor/src/index.ts @@ -113,7 +113,10 @@ export function getHealthchecks(): Healthchecks { label: 'SDK Installed', isRequired: true, 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, }), }, { diff --git a/package.json b/package.json index d65325f37..de4d36634 100644 --- a/package.json +++ b/package.json @@ -140,7 +140,7 @@ "expand-tilde": "^2.0.2", "express": "^4.15.2", "fb-watchman": "^2.0.0", - "flipper-doctor": "^0.6.0", + "flipper-doctor": "^0.6.1", "fs-extra": "^8.0.1", "immer": "^5.2.1", "immutable": "^4.0.0-rc.12", diff --git a/yarn.lock b/yarn.lock index 4fdd3e96f..4f17e6ad1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4192,10 +4192,10 @@ flatted@^2.0.0: resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.1.tgz#69e57caa8f0eacbc281d2e2cb458d46fdb449e08" integrity sha512-a1hQMktqW9Nmqr5aktAux3JMNqaucxGcjtjWnZLHX7yyPCmlSV3M54nGYbqT8K+0GhF3NBgmJCc3ma+WOgX8Jg== -flipper-doctor@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/flipper-doctor/-/flipper-doctor-0.6.0.tgz#850eaf5e2f7abfb6cb3db0a383f7aa09c35d8176" - integrity sha512-aUdsw2b+9oVs/5V3X1TGEETu5TdheriY18pt8PWbhhliln7mUv0dnpvdA02tLlLfHKQ0B07OUrHO/kFaFAfI9Q== +flipper-doctor@^0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/flipper-doctor/-/flipper-doctor-0.6.1.tgz#7a10cbe655293332c509d3ca37611bc32ee5d514" + integrity sha512-XRN5LqTK9J+2K5ixPwEODHYRyfL3hs9qDsKzcPoecoHP2DxPBOJNm2d2+J03lqFMedYE63a6+WhWUXOQoBRyEQ== dependencies: "@types/node" "^12.12.12" envinfo "^7.4.0"