mirror of
https://github.com/smittix/intercept.git
synced 2026-04-24 22:59:59 -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:
@@ -26,7 +26,7 @@ from __future__ import annotations
|
||||
from typing import Optional
|
||||
|
||||
from .base import CommandBuilder, SDRCapabilities, SDRDevice, SDRType
|
||||
from .detection import detect_all_devices, probe_rtlsdr_device
|
||||
from .detection import detect_all_devices, invalidate_device_cache, probe_rtlsdr_device
|
||||
from .rtlsdr import RTLSDRCommandBuilder
|
||||
from .limesdr import LimeSDRCommandBuilder
|
||||
from .hackrf import HackRFCommandBuilder
|
||||
@@ -231,4 +231,5 @@ __all__ = [
|
||||
'get_capabilities_for_type',
|
||||
# Device probing
|
||||
'probe_rtlsdr_device',
|
||||
'invalidate_device_cache',
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user