Check the list length before splicing (#57617)

This commit is contained in:
Wang Chi 2018-09-01 02:42:35 +08:00 committed by Ramya Rao
parent 966bc2b003
commit 071c6b2077

View file

@ -583,6 +583,10 @@ export class SuggestWidget implements IContentWidget, IVirtualDelegate<ICompleti
this.currentSuggestionDetails = createCancelablePromise(token => item.resolve(token));
this.currentSuggestionDetails.then(() => {
if (this.list.length < index) {
return;
}
// item can have extra information, so re-render
this.ignoreFocusEvents = true;
this.list.splice(index, 1, [item]);