Skip to content

Commit

Permalink
Initial state is attempting to be accessed prior to completion. (#289)
Browse files Browse the repository at this point in the history
Co-authored-by: Brandon Sneed <brandon@redf.net>
  • Loading branch information
alanjcharles and bsneed authored Jan 11, 2024
1 parent cefc56b commit 6bc0ed5
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ public class IntervalBasedFlushPolicy: FlushPolicy,
self.analytics?.store.subscribe(self, initialState: true) { [weak self] (state: System) in
guard let self = self else { return }
guard let a = self.analytics else { return }
self.flushTimer = QueueTimer(interval: a.configuration.values.flushInterval) { [weak self] in
guard let system: System = a.store.currentState() else { return }
self.flushTimer = QueueTimer(interval: system.configuration.values.flushInterval) { [weak self] in
self?.analytics?.flush()
}
}
Expand Down

0 comments on commit 6bc0ed5

Please sign in to comment.