mirror of
https://github.com/smittix/intercept.git
synced 2026-04-24 06:40:00 -07:00
fix: airband start crash when device selector not yet populated
When the /devices fetch hasn't completed or fails, parseInt on an empty select returns NaN which JSON-serializes to null. The backend then calls int(None) and raises TypeError. Fix both layers: frontend falls back to 0 on NaN, backend uses `or` defaults so null values don't bypass the fallback. Also adds a short TTL cache to detect_all_devices() so multiple concurrent callers on the same page load don't each spawn blocking subprocess probes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -3652,8 +3652,8 @@ sudo make install</code>
|
||||
|
||||
async function startAirband() {
|
||||
const frequency = getAirbandFrequency();
|
||||
const device = parseInt(document.getElementById('airbandDeviceSelect').value);
|
||||
const squelch = parseInt(document.getElementById('airbandSquelch').value);
|
||||
const device = parseInt(document.getElementById('airbandDeviceSelect').value) || 0;
|
||||
const squelch = parseInt(document.getElementById('airbandSquelch').value) || 0;
|
||||
|
||||
console.log('[AIRBAND] Starting with device:', device, 'freq:', frequency, 'squelch:', squelch);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user