From ca48aa8b4db346659e6ac21f5a97fbca0d1678da Mon Sep 17 00:00:00 2001 From: Jason Carr Date: Thu, 10 Jul 2014 11:34:08 -0700 Subject: [PATCH] Nulls in the data were causing errors, fixed --- knockout.bindings.orderable.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/knockout.bindings.orderable.js b/knockout.bindings.orderable.js index 855f089..0b1b96d 100644 --- a/knockout.bindings.orderable.js +++ b/knockout.bindings.orderable.js @@ -16,6 +16,12 @@ }, compare: function (left, right) { + if (typeof left === "undefined" || left === null) { + return -1; + } + if (typeof right === "undefined" || right === null) { + return 1; + } if (typeof left === 'string' || typeof right === 'string') { return left.localeCompare(right); }