We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7fe17db commit 9e2d4abCopy full SHA for 9e2d4ab
core/src/main/java/com/segment/analytics/kotlin/core/platform/plugins/StartupQueue.kt
@@ -64,8 +64,16 @@ class StartupQueue : Plugin, Subscriber {
64
65
private fun replayEvents() {
66
// replay the queued events to the instance of Analytics we're working with.
67
- while(!queuedEvents.isEmpty()) {
68
- analytics.process(queuedEvents.poll())
+ while (!queuedEvents.isEmpty()) {
+
69
+ val event = queuedEvents.poll()
70
71
+ // It is possible that event might actually be null due to time-slicing
72
+ // after checking if the queue is empty so we only process if the event
73
+ // if it is indeed not NULL.
74
+ event?.let {
75
+ analytics.process(it)
76
+ }
77
}
78
79
0 commit comments