Fix saving null profiles
| @@ -110,7 +110,7 @@ async function createConnectionProfile() { | ||
| 110 | 110 | const name = await callGenericPopup(template, POPUP_TYPE.INPUT, suggestedName, { rows: 2 }); |
| 111 | 111 | |
| 112 | 112 | if (!name) { |
| 113 | 113 | return null; |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | profile.name = name; |
| @@ -296,6 +296,9 @@ async function renderDetailsContent(details, detailsContent) { | ||
| 296 | 296 | const createButton = document.getElementById('create_connection_profile'); |
| 297 | 297 | createButton.addEventListener('click', async () => { |
| 298 | 298 | const profile = await createConnectionProfile(); |
| 299 | + if (!profile) { | |
| 300 | + return; | |
| 301 | + } | |
| 299 | 302 | extension_settings.connectionManager.profiles.push(profile); |
| 300 | 303 | extension_settings.connectionManager.selectedProfile = profile.id; |
| 301 | 304 | saveSettingsDebounced(); |