Skip to content

The only downloader you need. 下载器的集大成者。

fix(filesystem): 忽略格式非法的 file:// URL,避免剪贴板监听崩溃

tatakariaebccdc34d4a7
diff --git a/app/platform/filesystem.py b/app/platform/filesystem.py
index b53d01b4..fe0e82fb 100644
--- a/app/platform/filesystem.py
+++ b/app/platform/filesystem.py
@@ -74,7 +74,10 @@ def localFilePath(url: str, validSuffixes: set[str] | None = None) -> Path | Non
else:
return None
- path = Path(url2pathname(rawPath))
+ try:
+ path = Path(url2pathname(rawPath))
+ except OSError:
+ return None
if not path.is_file():
return None
if validSuffixes is not None and path.suffix.lower() not in validSuffixes: