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

Commit fabee838 authored by Schneider Victor-tulias's avatar Schneider Victor-tulias
Browse files

Fix launcher crash loop.

A null title in a cache entry causes a crash loop, however this title is necessary. Without the title, there is no point to caching the entry. Added logging and added a null check.

Test: started launcher with a forced null title and without.
Bug: 210847986
Change-Id: I4e434816b505b320b78efd90c910bc0a464e6175
parent d2214e58
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -265,7 +265,14 @@ public abstract class BaseIconCache {
        // (e.g. fallback icon, default icon). So we drop here since there's no point in caching
        // an empty entry.
        if (entry.bitmap.isNullOrLowRes()) return;
        entry.title = cachingLogic.getLabel(object);

        CharSequence entryTitle = cachingLogic.getLabel(object);
        if (entryTitle == null) {
            Log.d(TAG, "No label returned from caching logic instance: " + cachingLogic);
            return;
        }
        entry.title = entryTitle;

        entry.contentDescription = mPackageManager.getUserBadgedLabel(entry.title, user);
        if (cachingLogic.addToMemCache()) mCache.put(key, entry);