commit: 60a190530adf6d834348d90ef9234782169b8242
parent 4b43d55cf35063a782cfb771dd87244780d0731d
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Mon, 24 Dec 2018 02:44:39 +0100
javascript/sorttable.js: fallback on empty cells
Diffstat:
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/javascript/sorttable.js b/javascript/sorttable.js
@@ -76,6 +76,10 @@ sorttable = {
// Use data-value="" attribute if you want to override innerHTML
// Example: <td data-value="1337">Leet</td>
getElementValue : function(element) {
+ if(element === undefined) {
+ return -9999;
+ console.log("Warning: Empty cells found");
+ }
if (element.dataset.value) {
return element.dataset.value;
} else {