Merge pull request #4109 from matrix-org/travis/invite-spaces

Filter out empty strings when pasting IDs into the invite dialog
pull/21833/head
Travis Ralston 2020-02-21 13:37:02 -07:00 committed by GitHub
commit d088879c12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -801,7 +801,7 @@ export default class InviteDialog extends React.PureComponent {
];
const toAdd = [];
const failed = [];
const potentialAddresses = text.split(/[\s,]+/);
const potentialAddresses = text.split(/[\s,]+/).map(p => p.trim()).filter(p => !!p); // filter empty strings
for (const address of potentialAddresses) {
const member = possibleMembers.find(m => m.userId === address);
if (member) {