Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sources/Sentry/SentryBinaryImageCache.m
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ - (void)binaryImageAdded:(const SentryCrashBinaryImage *)image
}

SentryBinaryImageInfo *newImage = [[SentryBinaryImageInfo alloc] init];
newImage.name = imageName;
newImage.name = SENTRY_UNWRAP_NULLABLE(NSString, imageName);
newImage.UUID = [SentryBinaryImageCache convertUUID:image->uuid];
newImage.address = image->address;
newImage.vmAddress = image->vmAddress;
Expand Down
14 changes: 9 additions & 5 deletions Sources/Sentry/SentryBreadcrumb.m
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,19 @@ - (BOOL)isEqualToBreadcrumb:(SentryBreadcrumb *)breadcrumb
&& ![self.category isEqualToString:breadcrumb.category])
return NO;
if (self.timestamp != breadcrumb.timestamp
&& ![self.timestamp isEqualToDate:breadcrumb.timestamp])
&& ![self.timestamp isEqualToDate:SENTRY_UNWRAP_NULLABLE(NSDate, breadcrumb.timestamp)])
return NO;
if (self.type != breadcrumb.type && ![self.type isEqualToString:breadcrumb.type])
if (self.type != breadcrumb.type
&& ![self.type isEqualToString:SENTRY_UNWRAP_NULLABLE(NSString, breadcrumb.type)])
return NO;
if (self.origin != breadcrumb.origin && ![self.origin isEqualToString:breadcrumb.origin])
if (self.origin != breadcrumb.origin
&& ![self.origin isEqualToString:SENTRY_UNWRAP_NULLABLE(NSString, breadcrumb.origin)])
return NO;
if (self.message != breadcrumb.message && ![self.message isEqualToString:breadcrumb.message])
if (self.message != breadcrumb.message
&& ![self.message isEqualToString:SENTRY_UNWRAP_NULLABLE(NSString, breadcrumb.message)])
return NO;
if (self.data != breadcrumb.data && ![self.data isEqualToDictionary:breadcrumb.data])
if (self.data != breadcrumb.data
&& ![self.data isEqualToDictionary:SENTRY_UNWRAP_NULLABLE(NSDictionary, breadcrumb.data)])
return NO;
return YES;
}
Expand Down
6 changes: 4 additions & 2 deletions Sources/Sentry/SentryBreadcrumbTracker.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#import "SentryDefines.h"
#import "SentryDependencyContainer.h"
#import "SentryHub.h"
#import "SentryInternalDefines.h"
#import "SentryLogC.h"
#import "SentryReachability.h"
#import "SentryScope.h"
Expand Down Expand Up @@ -220,9 +221,10 @@ - (void)swizzleSendAction

NSDictionary *data = nil;
for (UITouch *touch in event.allTouches) {
if (touch.phase == UITouchPhaseCancelled || touch.phase == UITouchPhaseEnded) {
if (touch.view != nil
&& (touch.phase == UITouchPhaseCancelled || touch.phase == UITouchPhaseEnded)) {
data = [SentryBreadcrumbTracker
extractDataFromView:touch.view
extractDataFromView:SENTRY_UNWRAP_NULLABLE_VALUE(id, touch.view)
withAccessibilityIdentifier:self->_reportAccessibilityIdentifier];
}
}
Expand Down
3 changes: 2 additions & 1 deletion Sources/Sentry/SentryClient.m
Original file line number Diff line number Diff line change
Expand Up @@ -1053,7 +1053,8 @@ - (void)applyCurrentViewNamesToEventContext:(SentryEvent *)event withScope:(Sent
}
} else {
if (scope.currentScreen != nil) {
app[@"view_names"] = @[ scope.currentScreen ];
app[@"view_names"] =
@[ SENTRY_UNWRAP_NULLABLE(NSString, scope.currentScreen) ];
} else {
app[@"view_names"] = [SentryDependencyContainer.sharedInstance
.application relevantViewControllersNames];
Expand Down
2 changes: 1 addition & 1 deletion Sources/Sentry/SentryCoreDataTracker.m
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ - (void)addExtraInfoToSpan:(SentrySpan *)span withContext:(NSManagedObjectContex
__kindof NSPersistentStore *_Nonnull obj, NSUInteger idx, BOOL *_Nonnull stop) {
[systems addObject:obj.type];
if (obj.URL != nil) {
[names addObject:obj.URL.path];
[names addObject:SENTRY_UNWRAP_NULLABLE(NSString, obj.URL.path)];
} else {
[names addObject:@"(null)"];
}
Expand Down
12 changes: 10 additions & 2 deletions Sources/Sentry/SentryDebugImageProvider.m
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,11 @@ - (void)extractDebugImageAddressFromFrames:(NSArray<SentryFrame *> *)frames
NSMutableSet<NSString *> *imageAddresses = [[NSMutableSet alloc] init];

for (SentryThread *thread in threads) {
[self extractDebugImageAddressFromFrames:thread.stacktrace.frames intoSet:imageAddresses];
NSArray<SentryFrame *> *_Nullable frames = thread.stacktrace.frames;
if (frames != nil) {
[self extractDebugImageAddressFromFrames:SENTRY_UNWRAP_NULLABLE(NSArray, frames)
intoSet:imageAddresses];
}
}

return [self getDebugImagesForAddresses:imageAddresses isCrash:isCrash];
Expand Down Expand Up @@ -179,7 +183,11 @@ - (void)extractDebugImageAddressFromFrames:(NSArray<SentryFrame *> *)frames
NSMutableSet<NSString *> *imageAddresses = [[NSMutableSet alloc] init];

for (SentryThread *thread in threads) {
[self extractDebugImageAddressFromFrames:thread.stacktrace.frames intoSet:imageAddresses];
NSArray<SentryFrame *> *_Nullable frames = thread.stacktrace.frames;
if (frames != nil) {
[self extractDebugImageAddressFromFrames:SENTRY_UNWRAP_NULLABLE(NSArray, frames)
intoSet:imageAddresses];
}
}

return [self getDebugImagesForImageAddressesFromCache:imageAddresses];
Expand Down
4 changes: 3 additions & 1 deletion Sources/Sentry/SentryDevice.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
// </polyfills>

#import "SentryDevice.h"
#import "SentryInternalDefines.h"

#import <sys/sysctl.h>
#if TARGET_OS_WATCH
# import <WatchKit/WatchKit.h>
Expand Down Expand Up @@ -236,7 +238,7 @@
size_t size = sizeof(str);
int cmd[2] = { CTL_KERN, KERN_OSVERSION };
if (SENTRY_LOG_ERRNO(sysctl(cmd, sizeof(cmd) / sizeof(*cmd), str, &size, NULL, 0)) == 0) {
return [NSString stringWithUTF8String:str];
return SENTRY_UNWRAP_NULLABLE(NSString, [NSString stringWithUTF8String:str]);
}
return @"";
}
Expand Down
7 changes: 4 additions & 3 deletions Sources/Sentry/SentryProfiler.mm
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,12 @@
return NO;
}

SentryProfileOptions *options = sentry_profileConfiguration.profileOptions;

if (nil == options) {
SentryProfileOptions *_Nullable nullableOptions = sentry_profileConfiguration.profileOptions;
if (nil == nullableOptions) {
return !sentry_profileConfiguration.isContinuousV1;
}
SentryProfileOptions *_Nonnull options
= SENTRY_UNWRAP_NULLABLE(SentryProfileOptions, nullableOptions);

return sentry_profileAppStarts(options) && sentry_isTraceLifecycle(options);
}
Expand Down
4 changes: 3 additions & 1 deletion Sources/Sentry/SentryUserFeedbackIntegration.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#import "SentryUserFeedbackIntegration.h"
#import "SentryDependencyContainer.h"
#import "SentryInternalDefines.h"
#import "SentryOptions+Private.h"
#import "SentrySDK+Private.h"
#import "SentrySwift.h"
Expand All @@ -20,7 +21,8 @@ - (BOOL)installWithOptions:(SentryOptions *)options
}

_driver = [[SentryUserFeedbackIntegrationDriver alloc]
initWithConfiguration:options.userFeedbackConfiguration
initWithConfiguration:SENTRY_UNWRAP_NULLABLE(SentryUserFeedbackConfiguration,
options.userFeedbackConfiguration)
delegate:self
screenshotProvider:SentryDependencyContainer.sharedInstance.screenshot];
return YES;
Expand Down
Loading