Skip to content

Commit eaa6aa9

Browse files
committed
chore(*): apply extra check if activeNode is defined
1 parent a1b34d8 commit eaa6aa9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

projects/igniteui-angular/src/lib/grids/cell.component.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,8 @@ export class IgxGridCellComponent implements OnInit, OnChanges, OnDestroy {
779779
*/
780780
pointerenter = (event: PointerEvent) => {
781781
const isHierarchicalGrid = this.grid.nativeElement.tagName.toLowerCase() === 'igx-hierarchical-grid';
782-
if (isHierarchicalGrid && (!this.grid.navigation.activeNode.gridID || this.grid.navigation.activeNode.gridID !== this.gridID)) {
782+
if (!this.grid.navigation.activeNode ||
783+
(isHierarchicalGrid && (!this.grid.navigation.activeNode.gridID || this.grid.navigation.activeNode.gridID !== this.gridID))) {
783784
return;
784785
}
785786
const dragMode = this.selectionService.pointerEnter(this.selectionNode, event);
@@ -794,7 +795,7 @@ export class IgxGridCellComponent implements OnInit, OnChanges, OnDestroy {
794795
*/
795796
pointerup = (event: PointerEvent) => {
796797
const isHierarchicalGrid = this.grid.nativeElement.tagName.toLowerCase() === 'igx-hierarchical-grid';
797-
if (!isLeftClick(event) || (isHierarchicalGrid && (!this.grid.navigation.activeNode.gridID ||
798+
if (!isLeftClick(event) || !this.grid.navigation.activeNode || (isHierarchicalGrid && (!this.grid.navigation.activeNode.gridID ||
798799
this.grid.navigation.activeNode.gridID !== this.gridID))) { return; }
799800
if (this.selectionService.pointerUp(this.selectionNode, this.grid.onRangeSelection)) {
800801
this.grid.cdr.detectChanges();

0 commit comments

Comments
 (0)