| 297 | 297 | try { |
| 298 | 298 | const optionsUrl = urlJoin(request.body.url, '/sdapi/v1/options'); |
| 299 | 299 | const optionsResult = await fetch(optionsUrl, { headers: { 'Authorization': getBasicAuthHeader(request.body.auth) } }); |
| 300 | + if (optionsResult.ok) { |
| 300 | 301 | const optionsData = /** @type {any} */ (await optionsResult.json()); |
| 301 | 302 | const isForge = 'forge_preset' in optionsData; |
| 302 | 303 | |
| 303 | 304 | if (!isForge) { |
| 304 | 305 | _.unset(request.body, 'override_settings.forge_additional_modules'); |
| 305 | 306 | } |
| 307 | + } |
| 306 | 308 | } catch (error) { |
| 307 | 309 | console.log('SD WebUI failed to get options:', error); |
| 308 | 310 | } |