diff options
author | Narayan Kamath <narayan@google.com> | 2015-04-28 08:29:09 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2015-04-28 08:29:09 +0000 |
commit | b736868be917afd5d3ea7e8a8d3d658c4350a239 (patch) | |
tree | 3eb4ecf140058ea5592cad3b4f745750d69a52cb | |
parent | c29791d56abbbbaef9786f5d25ecc6c32975bd9f (diff) | |
parent | e58c7858a39d58a222fe8302dc5ffbe4a25c5bf1 (diff) | |
download | base-b736868be917afd5d3ea7e8a8d3d658c4350a239.tar.gz |
Merge "Fix NullPointerException in Bundle#hasFileDescriptors"
-rw-r--r-- | core/java/android/os/Bundle.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/core/java/android/os/Bundle.java b/core/java/android/os/Bundle.java index c5c537263bbd..133debb65ec1 100644 --- a/core/java/android/os/Bundle.java +++ b/core/java/android/os/Bundle.java @@ -211,8 +211,9 @@ public final class Bundle extends BaseBundle implements Cloneable, Parcelable { } else if (obj instanceof Parcelable[]) { Parcelable[] array = (Parcelable[]) obj; for (int n = array.length - 1; n >= 0; n--) { - if ((array[n].describeContents() - & Parcelable.CONTENTS_FILE_DESCRIPTOR) != 0) { + Parcelable p = array[n]; + if (p != null && ((p.describeContents() + & Parcelable.CONTENTS_FILE_DESCRIPTOR) != 0)) { fdFound = true; break; } |