OSDN Git Service

Fix NPE for invalid target exception
authorDoris Liu <tianliu@google.com>
Wed, 3 Feb 2016 19:10:49 +0000 (11:10 -0800)
committerDoris Liu <tianliu@google.com>
Wed, 3 Feb 2016 19:10:49 +0000 (11:10 -0800)
Change-Id: I57b319fae617792351c6ec9872c3b73cd25dc4e5

graphics/java/android/graphics/drawable/AnimatedVectorDrawable.java

index 0a3e27e..21ed7dd 100644 (file)
@@ -852,8 +852,8 @@ public class AnimatedVectorDrawable extends Drawable implements Animatable2 {
                         (VectorDrawable.VectorDrawableState) target, startTime);
             } else {
                 // Should never get here
                         (VectorDrawable.VectorDrawableState) target, startTime);
             } else {
                 // Should never get here
-                throw new UnsupportedOperationException("Target should be either VGroup, VPath, " +
-                        "or ConstantState, " + target.getClass() + " is not supported");
+                throw new UnsupportedOperationException("Target should be group, path or vector. " +
+                        target == null ? "Null target" : target.getClass() + " is not supported");
             }
         }
 
             }
         }