Allow null target in ObjectAnimator if the target has never been set
am: 4d04b1a446
Change-Id: I5438b8d79f6e245e8a87e1480023c0ac77243f10
This commit is contained in:
@@ -977,8 +977,9 @@ public final class ObjectAnimator extends ValueAnimator {
|
|||||||
@Override
|
@Override
|
||||||
void animateValue(float fraction) {
|
void animateValue(float fraction) {
|
||||||
final Object target = getTarget();
|
final Object target = getTarget();
|
||||||
if (target == null) {
|
if (mTarget != null && target == null) {
|
||||||
// We lost the target reference, cancel and clean up.
|
// We lost the target reference, cancel and clean up. Note: we allow null target if the
|
||||||
|
/// target has never been set.
|
||||||
cancel();
|
cancel();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user