aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenny Root <kenny@the-b.org>2009-01-13 17:49:23 +0000
committerKenny Root <kenny@the-b.org>2009-01-13 17:49:23 +0000
commitda2703f74fe3383195b1c249e5bbb44d6d4a0e45 (patch)
treeeb48a8df7ef3f90864654cb108df5d88c2c2271c /src
parent1322b4654fd09505b1bc4ef5aecc3bfd205a923d (diff)
downloadconnectbot-da2703f74fe3383195b1c249e5bbb44d6d4a0e45.tar.gz
connectbot-da2703f74fe3383195b1c249e5bbb44d6d4a0e45.tar.bz2
connectbot-da2703f74fe3383195b1c249e5bbb44d6d4a0e45.zip
Bounds checking
Diffstat (limited to 'src')
-rw-r--r--src/org/connectbot/ConsoleActivity.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/org/connectbot/ConsoleActivity.java b/src/org/connectbot/ConsoleActivity.java
index da543ce..4775c7b 100644
--- a/src/org/connectbot/ConsoleActivity.java
+++ b/src/org/connectbot/ConsoleActivity.java
@@ -226,8 +226,10 @@ public class ConsoleActivity extends Activity {
/* TODO Remove this workaround when ViewFlipper is fixed to listen
* to view removals. Android Issue 1784
*/
- if (flip.getDisplayedChild() >= flip.getChildCount())
- flip.setDisplayedChild(flip.getDisplayedChild());
+ final int numChildren = flip.getChildCount();
+ if (flip.getDisplayedChild() >= numChildren &&
+ numChildren > 0)
+ flip.setDisplayedChild(numChildren - 1);
updateEmptyVisible();
break;