Skip to content

Commit

Permalink
Handle null error by using optional chaining and checking for ! undef…
Browse files Browse the repository at this point in the history
…ined
  • Loading branch information
LeeWannacott committed May 29, 2023
1 parent 1357aed commit e354eb5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions public/table-sort.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ function tableSortJs(testingTableSortJS = false, domDocumentWindow = document) {
let foundMatch = false;
for (let key of Object.keys(inferableClasses)) {
let classRegexp = inferableClasses[key].regexp;
if (tableColumn.innerText) {
if (tableColumn.innerText.match(classRegexp) !== null) {
if (tableColumn?.innerText !== undefined) {
if (tableColumn.innerText.match(classRegexp)) {
foundMatch = true;
inferableClasses[key].count++;
}
Expand Down

0 comments on commit e354eb5

Please sign in to comment.