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

Commit 2f63ce63 authored by Jason Chiu's avatar Jason Chiu
Browse files

Fix the NPE in the Settings Tile lib

Move the key checker after ensureMetadataNotStale() since it might
update the key to null.

Bug: 286690307
Test: robotest
Change-Id: I6eaae2ca798d2deccea44137846fe9a4e294f26e
Merged-In: I6eaae2ca798d2deccea44137846fe9a4e294f26e
(cherry picked from commit f730153b)
parent 37674c23
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -284,10 +284,10 @@ public abstract class Tile implements Parcelable {
     * Optional key to use for this tile.
     */
    public String getKey(Context context) {
        ensureMetadataNotStale(context);
        if (!hasKey()) {
            return null;
        }
        ensureMetadataNotStale(context);
        if (mMetaData.get(META_DATA_PREFERENCE_KEYHINT) instanceof Integer) {
            return context.getResources().getString(mMetaData.getInt(META_DATA_PREFERENCE_KEYHINT));
        } else {