Skip to content

Commit

Permalink
Abort execution of completion block after dynamic config refresh comp…
Browse files Browse the repository at this point in the history
…letes if self is now nil (amplitude#288)
  • Loading branch information
Jamie Altreuter committed Oct 5, 2020
1 parent 3006833 commit 834f5b1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Sources/Amplitude/Amplitude.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}];
}
Expand Down

0 comments on commit 834f5b1

Please sign in to comment.