diff --git a/lib/editor/util/validation.js b/lib/editor/util/validation.js index 0a46d71d7..1219d19fd 100644 --- a/lib/editor/util/validation.js +++ b/lib/editor/util/validation.js @@ -84,7 +84,10 @@ export function validate ( case 'GTFS_ID': // Indices contains list of all indexes of occurrences of the ID value. const indices = [] - const idList = entities ? entities.map(e => e[name]) : [] + const idList = entities ? entities.map(e => { + // $FlowFixMe too many unions for flow to handle + return name in e ? e[name] : null + }) : [] let idx = idList.indexOf(value) while (idx !== -1) { indices.push(idx) diff --git a/lib/gtfsplus/components/GtfsPlusField.js b/lib/gtfsplus/components/GtfsPlusField.js index 2f16f446b..367cc09be 100644 --- a/lib/gtfsplus/components/GtfsPlusField.js +++ b/lib/gtfsplus/components/GtfsPlusField.js @@ -123,5 +123,6 @@ export default class GtfsPlusField extends Component { value={stopValue} /> ) } + return null } } diff --git a/lib/public/components/UserAccount.js b/lib/public/components/UserAccount.js index 16ad34f18..411803771 100644 --- a/lib/public/components/UserAccount.js +++ b/lib/public/components/UserAccount.js @@ -70,7 +70,10 @@ export default class UserAccount extends Component { render () { const {activeComponent, projectId, projects, user} = this.props const {profile} = user - if (!profile) return console.warn('User profile not found', user) + if (!profile) { + console.warn('User profile not found', user) + return null + } const subscriptions: Array = profile.app_metadata.datatools .find(dt => dt.client_id === process.env.AUTH0_CLIENT_ID).subscriptions const ACCOUNT_SECTIONS = [ diff --git a/package.json b/package.json index 269f445a6..8453b5f06 100644 --- a/package.json +++ b/package.json @@ -115,7 +115,7 @@ "express": "^4.16.4", "express-http-proxy": "^1.5.1", "extract-zip": "^1.6.7", - "flow-bin": "^0.77.0", + "flow-bin": "0.84", "flow-coverage-report": "^0.3.0", "fs-extra": "^6.0.1", "istanbul-middleware": "^0.2.2", diff --git a/yarn.lock b/yarn.lock index b151aa779..58244b240 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5368,16 +5368,11 @@ flatten@^1.0.2: resolved "https://registry.yarnpkg.com/flatten/-/flatten-1.0.2.tgz#dae46a9d78fbe25292258cc1e780a41d95c03782" integrity sha1-2uRqnXj74lKSJYzB54CkHZXAN4I= -flow-bin@0.84.0: +flow-bin@0.84, flow-bin@0.84.0: version "0.84.0" resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.84.0.tgz#4cb2364c750fb37a7840524fa62456b53f64cdcb" integrity sha512-ocji8eEYp+YfICsm+F6cIHUcD7v5sb0/ADEXm6gyUKdjQzmSckMrPUdZtyfP973t3YGHKliUMxMvIBHyR5LbXQ== -flow-bin@^0.77.0: - version "0.77.0" - resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.77.0.tgz#4e5c93929f289a0c28e08fb361a9734944a11297" - integrity sha1-TlyTkp8omgwo4I+zYalzSUShEpc= - flow-coverage-report@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/flow-coverage-report/-/flow-coverage-report-0.3.0.tgz#a22d52fc9fa9c24ae0be02712a6fe1ac156f0d93"