From 7ab9c4f93514b929362cd585c5fe9551b0ad1aa3 Mon Sep 17 00:00:00 2001 From: Gregor Lasnibat <143816208+lasniscinote@users.noreply.github.com> Date: Fri, 5 Jan 2024 15:15:24 +0100 Subject: [PATCH] (fix) Range and Type errors after clearing search box [SCI-9867] (#6877) --- .../assets/javascripts/jquery.dataTables.colResize.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/vendor/assets/javascripts/jquery.dataTables.colResize.js b/vendor/assets/javascripts/jquery.dataTables.colResize.js index 3a5eefa7d..012634c0e 100644 --- a/vendor/assets/javascripts/jquery.dataTables.colResize.js +++ b/vendor/assets/javascripts/jquery.dataTables.colResize.js @@ -117,9 +117,8 @@ fnReset: function() { let self = this; this._fnGetAllColumns().forEach(function(column) { - if (column.sWidth == null) { - return; - } + + if (typeof column.sWidth !== 'string' || column.sWidth === null) return; let widthResult = column.sWidth.match(/(\d+)/i), oldWidth = widthResult != null ? parseInt(widthResult[0]) : 0, @@ -149,9 +148,8 @@ self.s.state.originalTableWidth = this._fnGetTable().width(); cols.forEach(function (column) { - if (column.sWidth == null) { - return; - } + + if (typeof column.sWidth !== 'string' || column.sWidth === null) return; let widthResult = column.sWidth.match(/(\d+)/i), oldWidth = widthResult != null ? parseInt(widthResult[0]) : 0,