From 934baa63b34423756abcf16cfdbe1b44c05658aa Mon Sep 17 00:00:00 2001 From: Mangala SSS Khalsa Date: Thu, 18 Jun 2020 22:45:37 -0700 Subject: [PATCH] Editor: fix removeRow bug When OnDemandList is pruning rows it sometimes calls 'removeRow' on a preload node. Editor's 'removeRow' logic assumes that the node will always be a valid row node which causes an error when it is not. This commit adds a guard in `Editor#removeRow` to ensure that a dgrid row object for the node exists. --- Editor.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Editor.js b/Editor.js index 5bcd4d4ab..1012fbd20 100644 --- a/Editor.js +++ b/Editor.js @@ -79,8 +79,9 @@ define([ removeRow: function (rowElement) { var self = this; var focusedCell = this._focusedEditorCell; + var row = this.row(rowElement); - if (focusedCell && focusedCell.row.id === this.row(rowElement).id) { + if (focusedCell && row && focusedCell.row.id === row.id) { this._previouslyFocusedEditorCell = focusedCell; // Pause the focusout handler until after this row has had // time to re-render, if this removal is part of an update.