Guard against null parent in Launcher2.Search.clearAnimation()

Sometimes clearAnimation() is called on the search widget
when it has no parent, e.g. when it being removed from the
home screen. This caused an NPE, because clearAnimation()
called invalidate() on the parent.

This is a partial fix for: http://b/issue?id=2246760
This commit is contained in:
Bjorn Bringert
2009-11-21 21:38:05 +00:00
parent 730c408ccc
commit 600f188702
+2 -1
View File
@@ -253,7 +253,8 @@ public class Search extends LinearLayout
if (animation.hasEnded()
&& animation.getFillAfter()
&& animation.willChangeBounds()) {
((View) getParent()).invalidate();
View parent = (View) getParent();
if (parent != null) parent.invalidate();
} else {
invalidate();
}