Modern Apps git

← Modern-Apps.git

library: guard widget receiver async completion

Commit
4886b1cd5df67573674929fdce76dbd0e9ff9694
Author
Vayun Mathur <[email protected]>
When
2026-11-19 04:10 UTC (17 days ago)
Parents
e2e9ff7
The shared date-trigger widget refresh path also dereferenced the goAsync() pending result in a finally block. Treat the platform result as nullable so a receiver invoked without a live broadcast pending result cannot throw after the widget refresh finishes.

Verified with :library:widgets:testDebugUnitTest: 30 tests pass, and :calendar:testDevUnitTest remains green.

Diff

library/widgets/src/main/java/com/vayunmathur/library/widgets/MaWidgetReceiver.kt
diff --git a/library/widgets/src/main/java/com/vayunmathur/library/widgets/MaWidgetReceiver.kt b/library/widgets/src/main/java/com/vayunmathur/library/widgets/MaWidgetReceiver.ktindex 9faad24641..f54e93c819 100644--- a/library/widgets/src/main/java/com/vayunmathur/library/widgets/MaWidgetReceiver.kt+++ b/library/widgets/src/main/java/com/vayunmathur/library/widgets/MaWidgetReceiver.kt@@ -70,7 +70,7 @@ abstract class MaWidgetReceiver<W : GlanceAppWidget>(                         widgetFactory().updateAll(context)                     } catch (_: Exception) {                     } finally {-                        pending.finish()+                        pending?.finish()                     }                 }             }