Caused by java.lang.NullPointerException: Attempt to invoke interface method 'void java.util.concurrent.ScheduledExecutorService.shutdown()' on a null object reference
at com.launchdarkly.android.DiagnosticEventProcessor.stopScheduler(DiagnosticEventProcessor.java:88)
at com.launchdarkly.android.DiagnosticEventProcessor.close(DiagnosticEventProcessor.java:92)
at com.launchdarkly.android.LDClient.closeInternal(LDClient.java:458)
at com.launchdarkly.android.LDClient.closeInstances(LDClient.java:468)
at com.launchdarkly.android.LDClient.close(LDClient.java:451)
...
if LDClient.close is called before app is foregrounded, because DiagnosticEventProcessor.executorService is initialized inside DiagnosticEventProcessor.startScheduler which is called only when app is foregrounded for the first time.
With 2.14.1, this happens:
if
LDClient.close
is called before app is foregrounded, becauseDiagnosticEventProcessor.executorService
is initialized insideDiagnosticEventProcessor.startScheduler
which is called only when app is foregrounded for the first time.Suggest to check for
null
: