Skip to content

Commit a3714ee

Browse files
author
Juha Alhojoki
committed
people picker imageUrl was resolved by user email, when it should be resolved by user's accountName
1 parent b77ad17 commit a3714ee

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/services/PeopleSearchService.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -314,12 +314,11 @@ export default class SPPeopleSearchService {
314314
* Gets account name for user, falls back to description
315315
*/
316316
private getAccountName(element: any): string {
317+
if (!element) { return ""; }
317318
const loginName: string = element.LoginName || element.Key;
318319
if (loginName) {
319320
const loginParts: string[] = loginName.split("|");
320-
if (loginParts.length > 0) {
321-
return loginParts[loginParts.length - 1];
322-
}
321+
return loginParts[loginParts.length - 1];
323322
}
324323
return element.Description || "";
325324
}

0 commit comments

Comments
 (0)