mirror of
https://github.com/datahub-project/datahub.git
synced 2025-09-26 09:35:23 +00:00
* fix(login): Fix login error when corp user editable information is not present Check if the aspects are present before extracting the values * More stronger checks for presence of aspects in model
This commit is contained in:
parent
c29fd38c7f
commit
e936e2b856
@ -5,9 +5,8 @@ import com.linkedin.datahub.models.table.CompanyUser;
|
||||
import com.linkedin.datahub.models.table.User;
|
||||
import com.linkedin.datahub.models.table.UserEntity;
|
||||
import com.linkedin.identity.CorpUser;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.net.URISyntaxException;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
|
||||
public class CorpUserUtil {
|
||||
@ -33,10 +32,14 @@ public class CorpUserUtil {
|
||||
@Nonnull
|
||||
public static User toCorpUserView(CorpUser corpUser) {
|
||||
User user = new User();
|
||||
user.setEmail(corpUser.getInfo().getEmail());
|
||||
user.setName(corpUser.getInfo().getFullName());
|
||||
user.setUserName(corpUser.getUsername());
|
||||
user.setPictureLink(corpUser.getEditableInfo().getPictureLink().toString());
|
||||
if (corpUser.getInfo() != null) {
|
||||
user.setEmail(corpUser.getInfo().getEmail());
|
||||
user.setName(corpUser.getInfo().getFullName());
|
||||
}
|
||||
if (corpUser.getEditableInfo() != null) {
|
||||
user.setPictureLink(corpUser.getEditableInfo().getPictureLink().toString());
|
||||
}
|
||||
return user;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user