diff --git a/Sources/Sentry/SentryFileManager.m b/Sources/Sentry/SentryFileManager.m index 2b64b9d402..69a63c7582 100644 --- a/Sources/Sentry/SentryFileManager.m +++ b/Sources/Sentry/SentryFileManager.m @@ -270,7 +270,8 @@ - (void)deleteOldEnvelopesFromPath:(NSString *)envelopesPath } } -- (BOOL)isDirectory:(NSString *)path { +- (BOOL)isDirectory:(NSString *)path +{ BOOL isDir = NO; return [NSFileManager.defaultManager fileExistsAtPath:path isDirectory:&isDir] && isDir; } diff --git a/Sources/Sentry/SentrySessionReplayIntegration.m b/Sources/Sentry/SentrySessionReplayIntegration.m index ff8e5fbc5b..f24a3abf27 100644 --- a/Sources/Sentry/SentrySessionReplayIntegration.m +++ b/Sources/Sentry/SentrySessionReplayIntegration.m @@ -379,7 +379,7 @@ - (void)cleanUp NSDictionary *lastReplayInfo = [self lastReplayInfo]; NSString *lastReplayFolder = lastReplayInfo[@"path"]; - SentryFileManager * fileManager = SentryDependencyContainer.sharedInstance.fileManager; + SentryFileManager *fileManager = SentryDependencyContainer.sharedInstance.fileManager; // Mapping replay folder here and not in dispatched queue to prevent a race condition between // listing files and creating a new replay session. NSArray *replayFiles = [fileManager allFilesInFolder:replayDir.path]; @@ -393,7 +393,7 @@ - (void)cleanUp if ([file isEqualToString:lastReplayFolder]) { continue; } - + NSString *filePath = [replayDir.path stringByAppendingPathComponent:file]; // Check if the file is a directory before deleting it.