From 85c1e463503bc3d79b4e6e8dc9ef6b1b14c1ecc2 Mon Sep 17 00:00:00 2001 From: Extremesecrecy <10959169+extremesecrecy@users.noreply.github.com> Date: Wed, 23 Jul 2025 22:14:31 -0700 Subject: [PATCH] Handle Empty SampleRates Cont MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Prevents crashes when input/output devices report no sample rates by defaulting to the current rate or 48 kHz if needed Provides a fallback option in the UI so the selected rate is visible even when the device list is empty --- vite/src/pipedal/JackServerSettingsDialog.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/vite/src/pipedal/JackServerSettingsDialog.tsx b/vite/src/pipedal/JackServerSettingsDialog.tsx index 0b24df6..b1c66c3 100644 --- a/vite/src/pipedal/JackServerSettingsDialog.tsx +++ b/vite/src/pipedal/JackServerSettingsDialog.tsx @@ -520,7 +520,8 @@ const JackServerSettingsDialog = withStyles( let sampleRates = selectedInputDevice && selectedOutputDevice ? intersectArrays(selectedInputDevice.sampleRates, selectedOutputDevice.sampleRates) : (selectedInputDevice ? selectedInputDevice.sampleRates : (selectedOutputDevice ? selectedOutputDevice.sampleRates : [])); - + let sampleRateOptions = sampleRates.length === 0 ? [this.state.jackServerSettings.sampleRate || 48000] : sampleRates; + return ( { @@ -589,7 +590,7 @@ const JackServerSettingsDialog = withStyles( } }} > - {sampleRates.map((sr) => { + {sampleRateOptions.map((sr) => { return ({sr} ); })}