From 070807f148950af5fc7c7541c696c250d68749b1 Mon Sep 17 00:00:00 2001 From: "Timothy Z." Date: Fri, 27 Mar 2026 12:57:11 +0200 Subject: [PATCH] Fix crash when no extra option is selected in Discover Guard against `selectedExtra` being undefined when `options.find()` returns no match, preventing "Cannot read properties of undefined (reading 'deepLinks')" TypeError. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/routes/Discover/useSelectableInputs.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/routes/Discover/useSelectableInputs.js b/src/routes/Discover/useSelectableInputs.js index f548861da..95bfc6d63 100644 --- a/src/routes/Discover/useSelectableInputs.js +++ b/src/routes/Discover/useSelectableInputs.js @@ -54,13 +54,13 @@ const mapSelectableInputs = (discover, t) => { value }) })), - value: JSON.stringify({ + value: selectedExtra ? JSON.stringify({ href: selectedExtra.deepLinks.discover, value: selectedExtra.value, - }), + }) : undefined, title: options.some(({ selected, value }) => selected && value === null) ? () => t.string(name.toUpperCase()) - : t.string(selectedExtra.value), + : selectedExtra ? t.string(selectedExtra.value) : () => t.string(name.toUpperCase()), onSelect: (value) => { const { href } = JSON.parse(value); window.location = href;