File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 77#import " SentryRandom.h"
88#import " SentryScope+Private.h"
99#import " SentryTime.h"
10- #import " SentryUser+Private.h"
1110#import " SentryUserAccess.h"
1211#import " _SentryDispatchQueueWrapperInternal.h"
1312
Original file line number Diff line number Diff line change @@ -46,11 +46,12 @@ import Foundation
4646 }
4747
4848 private func decodeUser( from data: Data ) -> User ? {
49- guard let deserialized = SentrySerialization . deserializeDictionary ( fromJsonData: data) else {
50- SentrySDKLog . error ( " Failed to deserialize user, reason: data is not valid json " )
49+ do {
50+ let decoder = JSONDecoder ( )
51+ return try decoder. decode ( UserDecodable . self, from: data)
52+ } catch {
53+ SentrySDKLog . error ( " Failed to decode user, reason: \( error) " )
5154 return nil
5255 }
53-
54- return User ( dictionary: deserialized)
5556 }
5657}
You can’t perform that action at this time.
0 commit comments