Skip to content

Commit a404332

Browse files
committed
display receipt: remove another forcibly unwrapped optional
it was safe, though
1 parent c5156f4 commit a404332

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Sources/Swift/Display Receipt/DisplayReceiptCacheHelper.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ internal struct DisplayReceiptCacheHelper {
4343

4444
static func sharedDefaults() throws -> UserDefaults {
4545
let groupId = try self.sharedGroupId()
46-
return UserDefaults.init(suiteName: groupId)!
46+
guard let defaults = UserDefaults.init(suiteName: groupId)
47+
else { throw DisplayReceiptHelperError.appGroupError }
48+
return defaults
4749
}
4850

4951
// MARK: Methods updating cache files

0 commit comments

Comments
 (0)