Fix crash when re-enabling analytics.

This commit is contained in:
Jorge Martín 2023-04-03 11:30:14 +02:00
parent 95b30bb8e9
commit 2830459b6a

View File

@ -164,6 +164,7 @@ class DefaultVectorAnalytics @Inject constructor(
// When opting out, ensure that the queue is flushed first, or it will be flushed later (after user has revoked consent) // When opting out, ensure that the queue is flushed first, or it will be flushed later (after user has revoked consent)
posthog?.flush() posthog?.flush()
posthog?.optOut(true) posthog?.optOut(true)
posthog?.shutdown()
posthog = null posthog = null
} }
} }