From 39c1898a5f0b3a67a0109cf809fdbd89a783f19b Mon Sep 17 00:00:00 2001 From: Antonin Delpeuch Date: Mon, 8 Apr 2024 14:54:09 +0200 Subject: [PATCH] Avoid crashing when cell renderer throws an exception This will let the next cell renderers attempt to render the cell instead of aborting the rendering of the entire grid. For https://github.com/OpenRefine/CommonsExtension/issues/99. --- .../webapp/modules/core/scripts/views/data-table/cell-ui.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main/webapp/modules/core/scripts/views/data-table/cell-ui.js b/main/webapp/modules/core/scripts/views/data-table/cell-ui.js index 3d1ac1c7458d..c1a8d56c14ed 100644 --- a/main/webapp/modules/core/scripts/views/data-table/cell-ui.js +++ b/main/webapp/modules/core/scripts/views/data-table/cell-ui.js @@ -85,7 +85,11 @@ DataTableCellUI.prototype._render = function() { var renderedCell = undefined; for (let record of CellRendererRegistry.renderers) { - renderedCell = record.renderer.render(this._rowIndex, this._cellIndex, cell, this); + try { + renderedCell = record.renderer.render(this._rowIndex, this._cellIndex, cell, this); + } catch (e) { + continue; + } if (renderedCell) { break; }