Permalink
Browse files

Merge pull request #26 from joaquinmag/patch-1

Fixed bug Exception launched when it had no fields
  • Loading branch information...
2 parents e2a6c85 + 167f17a commit 3adf263f0bf22066e9b37d34a9023b74610535ec @pelegri pelegri committed Jan 30, 2013
@@ -46,7 +46,13 @@ protected void sublayout( int width, int height )
// There may be a few remaining pixels after dividing up the space
// we must split up the space between the first and last buttons
- int fieldWidth = width / numFields;
+
+ //if there are no fields the current fieldWidth should be 0
+ final int fieldWidth;
+ if (numFields == 0)
+ fieldWidth = 0;
+ else
+ fieldWidth = width / numFields;
int firstFieldExtra = 0;
int lastFieldExtra = 0;

0 comments on commit 3adf263

Please sign in to comment.