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); }