From f15bf0e76e479d2945defbd2704f9ec7739fb980 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 19 Mar 2018 18:09:42 -0700 Subject: [PATCH] locations cannot be null --- .../typescript/src/features/definitionProviderBase.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/extensions/typescript/src/features/definitionProviderBase.ts b/extensions/typescript/src/features/definitionProviderBase.ts index c56d36b62e8..f8928579e07 100644 --- a/extensions/typescript/src/features/definitionProviderBase.ts +++ b/extensions/typescript/src/features/definitionProviderBase.ts @@ -29,10 +29,8 @@ export default class TypeScriptDefinitionProviderBase { try { const response = await this.client.execute(definitionType, args, token); const locations: Proto.FileSpan[] = (response && response.body) || []; - if (!locations || locations.length === 0) { - return []; - } - return locations.map(location => typeConverters.Location.fromTextSpan(this.client.asUrl(location.file), location)); + return locations.map(location => + typeConverters.Location.fromTextSpan(this.client.asUrl(location.file), location)); } catch { return []; } -- GitLab