Handle missing body case

This commit is contained in:
Ryan Cavanaugh
2017-06-06 16:01:53 -07:00
parent 1f3ef7df7a
commit f395bc1d83
+7
View File
@@ -732,6 +732,13 @@ namespace ts.server {
const request = this.processRequest<protocol.GetEditsForRefactorRequest>(CommandNames.GetEditsForRefactor, args);
const response = this.processResponse<protocol.GetEditsForRefactorResponse>(request);
if (!response.body) {
return {
edits: []
};
}
const edits: FileTextChanges[] = this.convertCodeEditsToTextChanges(response.body.edits);
const renameFilename: string | undefined = response.body.renameFilename;