← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 17914: make sure that pageSize is always 1 or larger

 

------------------------------------------------------------
revno: 17914
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2015-01-08 18:12:28 +0700
message:
  make sure that pageSize is always 1 or larger
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/Pager.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/Pager.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/Pager.java	2014-08-16 12:55:45 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/Pager.java	2015-01-08 11:12:28 +0000
@@ -74,8 +74,8 @@
     public Pager( int page, int total, int pageSize )
     {
         this.page = page;
-        this.total = total;
-        this.pageSize = pageSize;
+        this.total = total > 0 ? total : 1;
+        this.pageSize = pageSize > 0 ? pageSize : 1;
 
         if ( this.page > getPageCount() )
         {