Skip to content

Commit 64ad6e1

Browse files
Added value check before calling endsWith function.
1 parent 7ff1fcd commit 64ad6e1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/controls/peoplepicker/PeoplePickerComponent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export class PeoplePicker extends React.Component<IPeoplePickerProps, IPeoplePic
9393
if (defaultSelectedUsers) {
9494
let selectedPersons: IPersonaProps[] = [];
9595
for (const userValue of props.defaultSelectedUsers) {
96-
if (userValue.endsWith("|inactive")) {
96+
if (userValue && userValue.endsWith("|inactive")) {
9797
const temp: string = userValue.slice(0, -9);
9898
if (temp) {
9999
const inactiveUser: IPersonaProps = { text: temp };

0 commit comments

Comments
 (0)