Skip to content

Commit 835ed22

Browse files
Revert "refactor: Add null-handling and tests for array sanitizing (getsentry#5738)"
This reverts commit 795dd39.
1 parent 9e12d6c commit 835ed22

File tree

5 files changed

+3
-189
lines changed

5 files changed

+3
-189
lines changed

Sources/Sentry/SentryArray.m renamed to Sources/Sentry/NSArray+SentrySanitize.m

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#import "SentryArray.h"
1+
#import "NSArray+SentrySanitize.h"
22
#import "SentryDateUtils.h"
33
#import "SentryInternalDefines.h"
44
#import "SentryNSDictionarySanitize.h"
@@ -14,13 +14,7 @@ + (NSArray *)sanitizeArray:(NSArray *)array;
1414
} else if ([rawValue isKindOfClass:NSNumber.class]) {
1515
[result addObject:rawValue];
1616
} else if ([rawValue isKindOfClass:NSDictionary.class]) {
17-
NSDictionary *_Nullable sanitizedDict = sentry_sanitize((NSDictionary *)rawValue);
18-
if (sanitizedDict == nil) {
19-
// Adding `nil` to an array is not allowed in Objective-C and raises an
20-
// `NSInvalidArgumentException`.
21-
continue;
22-
}
23-
[result addObject:SENTRY_UNWRAP_NULLABLE(NSDictionary, sanitizedDict)];
17+
[result addObject:sentry_sanitize((NSDictionary *)rawValue)];
2418
} else if ([rawValue isKindOfClass:NSArray.class]) {
2519
[result addObject:[SentryArray sanitizeArray:rawValue]];
2620
} else if ([rawValue isKindOfClass:NSDate.class]) {

Sources/Sentry/SentryNSDictionarySanitize.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#import "SentryNSDictionarySanitize.h"
2-
#import "SentryArray.h"
2+
#import "NSArray+SentrySanitize.h"
33
#import "SentryDateUtils.h"
44

55
NSDictionary *_Nullable sentry_sanitize(NSDictionary *_Nullable dictionary)

Tests/SentryTests/Categories/SentryArrayTests.swift

Lines changed: 0 additions & 179 deletions
This file was deleted.

Tests/SentryTests/SentryTests-Bridging-Header.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@
5555
#import "SentryAppStartTrackingIntegration.h"
5656
#import "SentryAppState.h"
5757
#import "SentryAppStateManager.h"
58-
#import "SentryArray.h"
5958
#import "SentryAttachment+Private.h"
6059
#import "SentryAutoBreadcrumbTrackingIntegration+Test.h"
6160
#import "SentryAutoBreadcrumbTrackingIntegration.h"

0 commit comments

Comments
 (0)