From ecb4835a16f80addfa430d8d47e883eb6cea1a33 Mon Sep 17 00:00:00 2001 From: Taloth Saldono Date: Fri, 31 Jul 2015 18:09:50 +0200 Subject: [PATCH] minor pageable code error. --- src/UI/Mixins/AsPageableCollection.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/UI/Mixins/AsPageableCollection.js b/src/UI/Mixins/AsPageableCollection.js index fea44968b..60145e569 100644 --- a/src/UI/Mixins/AsPageableCollection.js +++ b/src/UI/Mixins/AsPageableCollection.js @@ -19,8 +19,8 @@ module.exports = function() { originalEventHandler.apply(this, [].slice.call(arguments, 1)); - var totalPages = Math.ceil(this.state.totalRecords / pageSize); - var newPage = Math.min(currentPage, totalPages); + var totalPages = Math.max(1,Math.ceil(this.state.totalRecords / pageSize)); + var newPage = Math.min(currentPage, totalPages); if (newPage !== this.state.currentPage) { this.state.currentPage = newPage;