Fix NullPointerException in Bundle#hasFileDescriptors
Add null check for array elements in Bundle#hasFileDescriptors to avoid NPE on null valued array. Change-Id: Ic6ef8864ca6add023c7a69ba3c9474b0f6291723
This commit is contained in:
committed by
Narayan Kamath
parent
c29791d56a
commit
e58c7858a3
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user