From b9a6db3ef3ce1c9c857fbc2be9c4a78696cc5f36 Mon Sep 17 00:00:00 2001 From: miodragbogdanovic Date: Wed, 7 Mar 2018 16:18:59 +0100 Subject: [PATCH] IP address field is empty bug I'm using this plugin, and I'm getting the exception when this field is empty (null). One checking line on the beginning solved this problem for me. --- sorting/ip-address.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sorting/ip-address.js b/sorting/ip-address.js index 28ff323..c5d0716 100644 --- a/sorting/ip-address.js +++ b/sorting/ip-address.js @@ -18,6 +18,7 @@ jQuery.extend( jQuery.fn.dataTableExt.oSort, { "ip-address-pre": function ( a ) { + if (a == null) { return 0 } var i, item; var m = a.split("."), n = a.split(":"), @@ -100,4 +101,4 @@ jQuery.extend( jQuery.fn.dataTableExt.oSort, { "ip-address-desc": function ( a, b ) { return ((a < b) ? 1 : ((a > b) ? -1 : 0)); } -}); \ No newline at end of file +});