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

Commit 58d1fe98 authored by Lyn's avatar Lyn
Browse files

Fix NPE from null runnable

Fixes: 351498634
Test: treehugger
Flag: com.android.systemui.notification_avalanche_throttle_hun
Change-Id: I35999450fff387521a0623867b6d281858eca21a
parent c44566f4
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -91,7 +91,11 @@ constructor(dumpManager: DumpManager,
    }

    /** Run or delay Runnable for given HeadsUpEntry */
    fun update(entry: HeadsUpEntry?, runnable: Runnable, label: String) {
    fun update(entry: HeadsUpEntry?, runnable: Runnable?, label: String) {
        if (runnable == null) {
            log { "Runnable is NULL, stop update." }
            return
        }
        if (!NotificationThrottleHun.isEnabled) {
            runnable.run()
            return
@@ -147,7 +151,11 @@ constructor(dumpManager: DumpManager,
     * 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 (runnable == null) {
            log { "Runnable is NULL, stop delete." }
            return
        }
        if (!NotificationThrottleHun.isEnabled) {
            runnable.run()
            return