This commit is contained in:
leejh 2019-10-11 18:02:27 +09:00
parent b49a8313a9
commit 06ffd4e213

View File

@ -36,20 +36,24 @@ export class MessagesComponent implements OnInit {
}
getUserName(seq: number): string {
const userInfo: UserInfo[] = this.userInfos.filter(
user => user.seq === seq
);
if (!!userInfo && userInfo.length > 0) {
return userInfo[0].name;
if (!!this.userInfos) {
const userInfo: UserInfo[] = this.userInfos.filter(
user => user.seq === seq
);
if (!!userInfo && userInfo.length > 0) {
return userInfo[0].name;
}
}
return '(알수없는 사용자)';
}
getUserProfile(seq: number): string {
const userInfo: UserInfo[] = this.userInfos.filter(
user => user.seq === seq
);
if (!!userInfo && userInfo.length > 0) {
return this.profileImageRoot + userInfo[0].profileImageFile;
if (!!this.userInfos) {
const userInfo: UserInfo[] = this.userInfos.filter(
user => user.seq === seq
);
if (!!userInfo && userInfo.length > 0) {
return this.profileImageRoot + userInfo[0].profileImageFile;
}
}
return '';
}