Skip to content

Commit 131b3cc

Browse files
authored
fix issue LP-9783 - iOS SDK: Crash in LPEventCallbackManager (#215)
1 parent ac05606 commit 131b3cc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Leanplum-SDK/Classes/Features/Events/LPEventCallbackManager.m

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,11 @@ + (void)addEventCallbackAt:(NSInteger)index
5050
NSMutableDictionary *callbackMap = [LPEventCallbackManager eventCallbackMap];
5151
LPEventCallback *callback = [[LPEventCallback alloc] initWithResponseBlock:responseBlock
5252
errorBlock:errorBlock];
53-
callbackMap[@(index)] = callback;
53+
NSNumber *atIndex = @(index);
54+
55+
if (callbackMap && callback && atIndex) {
56+
callbackMap[atIndex] = callback;
57+
}
5458
}
5559

5660
+ (void)invokeSuccessCallbacksOnResponses:(id)responses

0 commit comments

Comments
 (0)