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

Commit c0ecb0a9 authored by Lyn's avatar Lyn
Browse files

Null check AvalancheController.delete

Bug: 331192804
Test: manual
Change-Id: I262bcdc4d4a7515effc06fb22914f5e47e9d4375
parent 47068c2b
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -106,13 +106,16 @@ class AvalancheController @Inject constructor() {
     * Run or ignore Runnable for given HeadsUpEntry. If entry was never shown, ignore and delete
     * all Runnables associated with that entry.
     */
    fun delete(entry: HeadsUpEntry, runnable: Runnable, label: String) {
    fun delete(entry: HeadsUpEntry?, runnable: Runnable, label: String) {
        if (!NotificationThrottleHun.isEnabled) {
            runnable.run()
            return
        }
        val fn = "[$label] => AvalancheController.delete " + getKey(entry)

        if (entry == null) {
            log { "$fn => cannot remove NULL entry" }
            return
        }
        if (entry in nextMap) {
            log { "$fn => [remove from next]" }
            if (entry in nextMap) nextMap.remove(entry)