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

locations cannot be null

上级 62211f51
......@@ -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 [];
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册