Allow null target in ObjectAnimator if the target has never been set

BUG: 31684571
Test: http://ag/1484115

Change-Id: I867fc3f93ddf70c58ae4387317ac875c5bafbebe
This commit is contained in:
Doris Liu
2016-09-26 15:12:46 -07:00
parent 3b2f771069
commit 4d04b1a446

View File

@@ -977,8 +977,9 @@ public final class ObjectAnimator extends ValueAnimator {
@Override
void animateValue(float fraction) {
final Object target = getTarget();
if (target == null) {
// We lost the target reference, cancel and clean up.
if (mTarget != null && target == null) {
// We lost the target reference, cancel and clean up. Note: we allow null target if the
/// target has never been set.
cancel();
return;
}