Permalink
Browse files

[fix] Fixed error in case that set sortBy and totalResults = 0

  • Loading branch information...
1 parent 9f7b386 commit 09a5ea5fbe6ceb0a7fd95f418db4cf8916a217e0 @masuP9 masuP9 committed Jun 28, 2015
Showing with 2 additions and 2 deletions.
  1. +1 −1 flexibleSearch.js
  2. +1 −1 flexibleSearch.min.js
View
@@ -551,7 +551,7 @@
var limitIdx = Number(limit) + Number(offset);
resultJSON.totalResults = cloneItems.length;
// Sort
- if (sortBy !== "" && sortBy in cloneItems[0]) {
+ if (resultJSON.totalResults !== 0 && sortBy !== "" && sortBy in cloneItems[0]) {
if (sortOrder !== "ascend") {
sortOrder = "descend";
}
Oops, something went wrong.

0 comments on commit 09a5ea5

Please sign in to comment.