Explorar o código

Fixed the getTableCellsInSelection helper failing when a range does not contain an elements.

Aleksander Nowodzinski %!s(int64=5) %!d(string=hai) anos
pai
achega
7eab23588a
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      packages/ckeditor5-table/src/tableselection/utils.js

+ 1 - 1
packages/ckeditor5-table/src/tableselection/utils.js

@@ -42,7 +42,7 @@ export function getTableCellsInSelection( selection ) {
 	for ( const range of selection.getRanges() ) {
 		const element = getRangeContainedElement( range );
 
-		if ( element.is( 'tableCell' ) ) {
+		if ( element && element.is( 'tableCell' ) ) {
 			cells.push( element );
 		}
 	}