Skip to content

Commit e00a493

Browse files
authored
fix: setActiveCellInternal() shouldn't throw when cell/row undefined (#941)
1 parent 0f07161 commit e00a493

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

slick.grid.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5168,7 +5168,7 @@ if (typeof Slick === "undefined") {
51685168
}
51695169

51705170
function setActiveCellInternal(newCell, opt_editMode, preClickModeOn, suppressActiveCellChangedEvent, e) {
5171-
if (activeCellNode !== null) {
5171+
if (activeCellNode !== null && activeCellNode !== undefined) {
51725172
makeActiveCellNormal();
51735173
activeCellNode.classList.remove("active");
51745174
if (rowsCache[activeRow] && rowsCache[activeRow].rowNode) {
@@ -5181,7 +5181,7 @@ if (typeof Slick === "undefined") {
51815181
var activeCellChanged = (activeCellNode !== newCell);
51825182
activeCellNode = newCell;
51835183

5184-
if (activeCellNode != null) {
5184+
if (activeCellNode !== null && activeCellNode !== undefined) {
51855185
var activeCellOffset = utils.offset(activeCellNode);
51865186

51875187
var rowOffset = Math.floor(utils.offset(utils.parents(activeCellNode, '.grid-canvas')[0]).top);

0 commit comments

Comments
 (0)