Skip to content

Commit

Permalink
fix: fix the compatible issue with macOSSonoma
Browse files Browse the repository at this point in the history
  • Loading branch information
Alyssa.Yu authored and Alyssa.Yu committed Sep 14, 2023
1 parent 94160a5 commit 09c2922
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Sources/Amplitude/AMPIdentifyInterceptor.m
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ - (NSMutableDictionary *)intercept:(NSMutableDictionary *_Nonnull)event {
[self scheduleTransfer];

// Event is intercepted, return nil
return nil;
return [NSMutableDictionary dictionary];
} else if ([userPropertyOperations objectForKey:AMP_OP_CLEAR_ALL] != nil) {
// Clear all pending intercepted Identify's
[_dbHelper removeInterceptedIdentifys:[_dbHelper getLastSequenceNumber]];
Expand Down
2 changes: 1 addition & 1 deletion Sources/Amplitude/Amplitude.m
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,7 @@ - (void)logEvent:(NSString *)eventType withEventProperties:(NSDictionary *)event
}

event = [self->_identifyInterceptor intercept:event];
if (event != nil) {
if ([event count] != 0) {
// convert event dictionary to JSON String
NSError *error = nil;
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:[AMPUtils makeJSONSerializable:event] options:0 error:&error];
Expand Down

0 comments on commit 09c2922

Please sign in to comment.