summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWang Kun <kun2.wang@sonyericsson.com>2010-11-24 13:38:20 +0100
committerJohan Redestig <johan.redestig@sonyericsson.com>2010-11-24 13:38:20 +0100
commit7e2f9e85a05554e3c04ee982e9125a5d45b48002 (patch)
tree05f082933f966d5b6adf7f7bbd7f8e2ea10cd8ef
parent6e031150ce7926b5e90046508d8e6964cf14e166 (diff)
downloadGallery3D-7e2f9e85a05554e3c04ee982e9125a5d45b48002.tar.gz
Fix for crash in PathBarLayer::recomputeComponents
The crash is triggered by our stability test suite. Adding a test for null on the component to follow the pattern from elsewhere in the class. java.lang.NullPointerException atcom.cooliris.media.PathBarLayer.recomputeComponents(PathBarLayer.java:255) atcom.cooliris.media.PathBarLayer.pushLabel(PathBarLayer.java:27) atcom.cooliris.media.GridLayer.setState(GridLayer.java:316) atcom.cooliris.media.GridInputProcessor.setCurrentSelectedSlot(GridInputProcessor.java:113) atcom.cooliris.media.GridLayer.setSingleImage(GridLayer.java:1492) atcom.cooliris.media.Gallery$1.run(Gallery.java:194) Change-Id: I0c088de34026e0be039e76e0a6107eac093a313e
-rw-r--r--src/com/cooliris/media/PathBarLayer.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/com/cooliris/media/PathBarLayer.java b/src/com/cooliris/media/PathBarLayer.java
index c09c407..21e3a2a 100644
--- a/src/com/cooliris/media/PathBarLayer.java
+++ b/src/com/cooliris/media/PathBarLayer.java
@@ -290,8 +290,10 @@ public final class PathBarLayer extends Layer {
int numComponents = mComponents.size();
for (int i = 0; i < numComponents; i++) {
Component component = mComponents.get(i);
- width -= (component.getIconWidth() + 20.0f * App.PIXEL_DENSITY);
- component.computeLabel(width);
+ if (component != null) {
+ width -= (component.getIconWidth() + 20.0f * App.PIXEL_DENSITY);
+ component.computeLabel(width);
+ }
}
}
}