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

Commit ca0c6dc5 authored by Lyn Han's avatar Lyn Han Committed by Android (Google) Code Review
Browse files

Merge "Null check AvalancheController.delete" into main

parents 01d88d2b c0ecb0a9
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -115,13 +115,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)