Avoid crash after ve.dm.Surface.purgeHistory().

The selection property is never null; it is initialized to Range(0,0).
If it is set to null in purgeHistory(), the next call to
ve.dm.Surface.change() will crash.

Change-Id: Ia45c0ba26291e8ad09c445fdf2323710b5ab409f
This commit is contained in:
C. Scott Ananian 2013-08-27 09:34:55 -04:00
parent d0d0e156b8
commit 7fb7665608

View file

@ -125,7 +125,7 @@ ve.dm.Surface.prototype.purgeHistory = function () {
if ( !this.enabled ) {
return;
}
this.selection = null;
this.selection = new ve.Range( 0, 0 );
this.smallStack = [];
this.bigStack = [];
this.undoIndex = 0;