File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -391,9 +391,15 @@ - (SentryUser *_Nullable)createUser:(NSDictionary *_Nonnull)user {
391391 userId = [NSString stringWithFormat: @" %@ " , user[@" id" ]];
392392 }
393393 SentryUser *sentryUser = [[SentryUser alloc ] init ];
394- sentryUser.userId = userId;
395- sentryUser.email = [NSString stringWithFormat: @" %@ " , user[@" email" ]];
396- sentryUser.username = [NSString stringWithFormat: @" %@ " , user[@" username" ]];
394+ if (nil != userId) {
395+ sentryUser.userId = userId;
396+ }
397+ if (nil != user[@" email" ]) {
398+ sentryUser.email = [NSString stringWithFormat: @" %@ " , user[@" email" ]];
399+ }
400+ if (nil != user[@" username" ]) {
401+ sentryUser.username = [NSString stringWithFormat: @" %@ " , user[@" username" ]];
402+ }
397403 sentryUser.extra = [RCTConvert NSDictionary: user[@" extra" ]];
398404 return sentryUser;
399405}
You can’t perform that action at this time.
0 commit comments