Skip to content

Commit

Permalink
Avoid crashing when cell renderer throws an exception
Browse files Browse the repository at this point in the history
This will let the next cell renderers attempt to render the cell
instead of aborting the rendering of the entire grid.

For OpenRefine/CommonsExtension#99.
  • Loading branch information
wetneb committed Apr 8, 2024
1 parent 58710e8 commit 39c1898
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion main/webapp/modules/core/scripts/views/data-table/cell-ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 39c1898

Please sign in to comment.