Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e58c7858 authored by Taiju Tsuiki's avatar Taiju Tsuiki Committed by Narayan Kamath
Browse files

Fix NullPointerException in Bundle#hasFileDescriptors

Add null check for array elements in Bundle#hasFileDescriptors to avoid NPE on
null valued array.

Change-Id: Ic6ef8864ca6add023c7a69ba3c9474b0f6291723
parent c29791d5
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -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;
                            }