Fix saving null profiles

4c4477098d061a513684bd31a9c7aede4807aca9

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

1 files changed, +4 -1Showing whitespace changes
public/scripts/extensions/connection-manager/index.js+4 -1
@@ -110,7 +110,7 @@ async function createConnectionProfile() {
110110 const name = await callGenericPopup(template, POPUP_TYPE.INPUT, suggestedName, { rows: 2 });
111111
112112 if (!name) {
113113 return null;
114114 }
115115
116116 profile.name = name;
@@ -296,6 +296,9 @@ async function renderDetailsContent(details, detailsContent) {
296296 const createButton = document.getElementById('create_connection_profile');
297297 createButton.addEventListener('click', async () => {
298298 const profile = await createConnectionProfile();
299+ if (!profile) {
300+ return;
301+ }
299302 extension_settings.connectionManager.profiles.push(profile);
300303 extension_settings.connectionManager.selectedProfile = profile.id;
301304 saveSettingsDebounced();