Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,15 @@ public static String getValueAsStringForKey(ReadableMap map, String key) {
return value;
}

public static WritableMap deconstructRegistration(Registration registration) {
public static WritableMap deconstructRegistration(@Nullable Registration registration) {
WritableMap registrationMap = Arguments.createMap();
if (registration == null) {
// Intercom.client().fetchLoggedInUserAttributes() returns null when no user is
// logged in (e.g. after the OS kills and restarts the process, clearing the session).
// Return an empty map to match the iOS bridge, which resolves an empty dictionary
// for the same "no logged-in user" case instead of crashing.
return registrationMap;
}
if (registration.getEmail() != null) {
registrationMap.putString("email", registration.getEmail());
}
Expand Down