提交 f15bf0e7 编写于 作者: M Matt Bierner

locations cannot be null

上级 62211f51
...@@ -29,10 +29,8 @@ export default class TypeScriptDefinitionProviderBase { ...@@ -29,10 +29,8 @@ export default class TypeScriptDefinitionProviderBase {
try { try {
const response = await this.client.execute(definitionType, args, token); const response = await this.client.execute(definitionType, args, token);
const locations: Proto.FileSpan[] = (response && response.body) || []; const locations: Proto.FileSpan[] = (response && response.body) || [];
if (!locations || locations.length === 0) { return locations.map(location =>
return []; typeConverters.Location.fromTextSpan(this.client.asUrl(location.file), location));
}
return locations.map(location => typeConverters.Location.fromTextSpan(this.client.asUrl(location.file), location));
} catch { } catch {
return []; return [];
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册