File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2159,14 +2159,14 @@ Terminal.prototype.nextStop = function(x) {
21592159 * @param {number } y The line in which to operate.
21602160 */
21612161Terminal . prototype . eraseRight = function ( x , y ) {
2162- var line = this . lines . get ( this . ybase + y )
2163- , ch = [ this . eraseAttr ( ) , ' ' , 1 ] ; // xterm
2164-
2165-
2162+ var line = this . lines . get ( this . ybase + y ) ;
2163+ if ( ! line ) {
2164+ return ;
2165+ }
2166+ var ch = [ this . eraseAttr ( ) , ' ' , 1 ] ; // xterm
21662167 for ( ; x < this . cols ; x ++ ) {
21672168 line [ x ] = ch ;
21682169 }
2169-
21702170 this . updateRange ( y ) ;
21712171} ;
21722172
@@ -2178,12 +2178,15 @@ Terminal.prototype.eraseRight = function(x, y) {
21782178 * @param {number } y The line in which to operate.
21792179 */
21802180Terminal . prototype . eraseLeft = function ( x , y ) {
2181- var line = this . lines . get ( this . ybase + y )
2182- , ch = [ this . eraseAttr ( ) , ' ' , 1 ] ; // xterm
2183-
2181+ var line = this . lines . get ( this . ybase + y ) ;
2182+ if ( ! line ) {
2183+ return ;
2184+ }
2185+ var ch = [ this . eraseAttr ( ) , ' ' , 1 ] ; // xterm
21842186 x ++ ;
2185- while ( x -- ) line [ x ] = ch ;
2186-
2187+ while ( x -- ) {
2188+ line [ x ] = ch ;
2189+ }
21872190 this . updateRange ( y ) ;
21882191} ;
21892192
You can’t perform that action at this time.
0 commit comments