From 93a7094cc3fef555adde62888b551d807a0d2a6e Mon Sep 17 00:00:00 2001 From: Jamie Altreuter Date: Mon, 5 Oct 2020 14:04:30 -0700 Subject: [PATCH] Abort execution of completion block after dynamic config refresh completes if self is now nil (#288) --- Sources/Amplitude/Amplitude.m | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Sources/Amplitude/Amplitude.m b/Sources/Amplitude/Amplitude.m index 41911fc3..c56d65be 100644 --- a/Sources/Amplitude/Amplitude.m +++ b/Sources/Amplitude/Amplitude.m @@ -825,6 +825,9 @@ - (void)refreshDynamicConfig { __weak typeof(self) weakSelf = self; [[AMPConfigManager sharedInstance] refresh:^{ __strong typeof(self) strongSelf = weakSelf; + if (strongSelf == nil) { + return; + } strongSelf->_serverUrl = [AMPConfigManager sharedInstance].ingestionEndpoint; }]; }