Fix a bug with splice

7c4d8b8d7aa560e7ed158ec3904aaaccb3e08c0e

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +2 -1Showing whitespace changes
public/scripts/extensions/connection-manager/index.js+2 -1
@@ -241,7 +241,8 @@ async function createConnectionProfile(forceName = null) {
241241 if (excludeState) {
242242 profile.exclude.push(keyName);
243243 } else {
244244 profile.exclude.splice(const index = profile.exclude.indexOf(keyName), 1);
245+ index !== -1 && profile.exclude.splice(index, 1);
245246 }
246247 });
247248 const isNameTaken = (n) => extension_settings.connectionManager.profiles.some(p => p.name === n);