Skip to content

Commit d27ad64

Browse files
committed
fix: Move file manager URL constructing to Swift
1 parent ca1c55d commit d27ad64

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## Unreleased
4+
5+
### Fixes
6+
7+
- Fixes a possible crash from ObjC to Swift nullability conversion in SentryFileManager (#6899)
8+
39
## 9.0.0-rc.1
410

511
### Breaking Changes

Sources/Sentry/SentryFileManagerHelper.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,9 @@ - (void)createPathsWithOptions:(SentryOptions *_Nullable)options
191191

192192
#pragma mark - Convenience Accessors
193193

194-
- (NSURL *)getSentryPathAsURL
194+
- (NSString *)getSentryPath
195195
{
196-
return [NSURL fileURLWithPath:self.sentryPath];
196+
return self.sentryPath;
197197
}
198198

199199
#pragma mark - Envelope

Sources/Sentry/include/SentryFileManagerHelper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ SENTRY_NO_INIT
5858
- (void)deleteAllEnvelopes;
5959

6060
#pragma mark - Convenience Accessors
61-
- (NSURL *)getSentryPathAsURL;
61+
- (NSString *)getSentryPath;
6262

6363
#pragma mark - State
6464
- (void)moveState:(NSString *)stateFilePath toPreviousState:(NSString *)previousStateFilePath;

Sources/Swift/Helper/SentryFileManager.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
}
8989

9090
@objc public func getSentryPathAsURL() -> URL {
91-
helper.getSentryPathAsURL()
91+
URL(fileURLWithPath: helper.getSentryPath())
9292
}
9393

9494
@objc public func moveState(_ stateFilePath: String, toPreviousState previousStateFilePath: String) {

0 commit comments

Comments
 (0)