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

Commit 2be4886d authored by Lyn's avatar Lyn
Browse files

Fix AvalancheController.update NPE when HeadsUpEntry is null

Fixes: 330783250
Test: manual => no NPE repro with this change
Change-Id: I515ee4ae18bac1c6e9ee549a9f84e737bc5f959c
parent fa267aea
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -64,13 +64,16 @@ class AvalancheController @Inject constructor(
    }

    /** Run or delay Runnable for given HeadsUpEntry */
    fun update(entry: HeadsUpEntry, runnable: Runnable, label: String) {
    fun update(entry: HeadsUpEntry?, runnable: Runnable, label: String) {
        if (!NotificationThrottleHun.isEnabled) {
            runnable.run()
            return
        }
        val fn = "[$label] => AvalancheController.update ${getKey(entry)}"

        if (entry == null) {
            log { "Entry is NULL, stop update." }
            return;
        }
        if (debug) {
            debugRunnableLabelMap[runnable] = label
        }