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

Commit 97a72f66 authored by Irfan Sheriff's avatar Irfan Sheriff
Browse files

Handle missing static for CREATOR

I made a mistake of missing out on static for CREATOR on a Parcelable
and it threw a NPE which was not obvious. We do not get NoSuchFieldException
when CREATOR exists but is not static.

Change-Id: Ib06f60797c00722075255d45e8189f8cebef9ae2
parent d6a7925d
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -2087,6 +2087,10 @@ public final class Parcel {
                                        + "Parcelable.Creator object called "
                                        + " CREATOR on class " + name);
                }
                catch (NullPointerException e) {
                    throw new BadParcelableException("Parcelable protocol requires "
                            + "the CREATOR object to be static on class " + name);
                }
                if (creator == null) {
                    throw new BadParcelableException("Parcelable protocol requires a "
                                        + "Parcelable.Creator object called "