Fix deref of undefined race on startup.

This can happen if you interact with the editor while vim mode is still
loading.
This commit is contained in:
Brandon Bloom 2017-09-03 13:15:26 -07:00 committed by Horace He
parent b6d72d95fa
commit 6ef147db41

View File

@ -685,7 +685,10 @@ export class ModeHandler implements vscode.Disposable {
}
// See comment about whatILastSetTheSelectionTo.
if (this._vimState.whatILastSetTheSelectionTo.isEqual(selection)) {
if (
this._vimState.whatILastSetTheSelectionTo &&
this._vimState.whatILastSetTheSelectionTo.isEqual(selection)
) {
return;
}