From c906b9eccf08417aeda7e0f0e525f872c727e6c9 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 21 Feb 2020 13:26:37 -0700 Subject: [PATCH] Filter out empty strings when pasting IDs into the invite dialog Fixes https://github.com/vector-im/riot-web/issues/12459 --- src/components/views/dialogs/InviteDialog.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/views/dialogs/InviteDialog.js b/src/components/views/dialogs/InviteDialog.js index 5c222182de..587fb9e454 100644 --- a/src/components/views/dialogs/InviteDialog.js +++ b/src/components/views/dialogs/InviteDialog.js @@ -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) {