summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2014-06-13 15:53:30 -0700
committerKeith Packard <keithp@keithp.com>2014-06-13 15:53:30 -0700
commit191ea4a7bbcb22d70c648a9ba746f1061e6f74cb (patch)
tree52d7e7007de864ddbc6de1c95fac05fd6650b162
parent3f7e885055f8a97f334e0cd3163b760b174114b6 (diff)
altosdroid: Don't crash when the map is touched
The map 'canScroll' method was crashing when dereferencing a null value somewhere. Just check all of them and bail instead of crashing. Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r--altosdroid/src/org/altusmetrum/AltosDroid/AltosViewPager.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/AltosViewPager.java b/altosdroid/src/org/altusmetrum/AltosDroid/AltosViewPager.java
index ebddc266..223ae75a 100644
--- a/altosdroid/src/org/altusmetrum/AltosDroid/AltosViewPager.java
+++ b/altosdroid/src/org/altusmetrum/AltosDroid/AltosViewPager.java
@@ -34,10 +34,14 @@ public class AltosViewPager extends ViewPager {
@Override
protected boolean canScroll(View v, boolean checkV, int dx, int x, int y) {
- if(v.getClass().getPackage().getName().startsWith("maps.")){
+ if(v.getClass() != null &&
+ v.getClass().getPackage() != null &&
+ v.getClass().getPackage().getName() != null &&
+ v.getClass().getPackage().getName().startsWith("maps."))
+ {
return true;
}
return super.canScroll(v, checkV, dx, x, y);
}
-} \ No newline at end of file
+}