mirror of https://github.com/astral-sh/ruff
Fix file watcher panic when event has no paths (#14364)
This commit is contained in:
parent
c847cad389
commit
a6a3d3f656
|
|
@ -210,7 +210,15 @@ impl Debouncer {
|
||||||
}
|
}
|
||||||
|
|
||||||
let kind = event.kind;
|
let kind = event.kind;
|
||||||
let path = match SystemPathBuf::from_path_buf(event.paths.into_iter().next().unwrap()) {
|
|
||||||
|
// There are cases where paths can be empty.
|
||||||
|
// https://github.com/astral-sh/ruff/issues/14222
|
||||||
|
let Some(path) = event.paths.into_iter().next() else {
|
||||||
|
tracing::debug!("Ignoring change event with kind '{kind:?}' without a path",);
|
||||||
|
return;
|
||||||
|
};
|
||||||
|
|
||||||
|
let path = match SystemPathBuf::from_path_buf(path) {
|
||||||
Ok(path) => path,
|
Ok(path) => path,
|
||||||
Err(path) => {
|
Err(path) => {
|
||||||
tracing::debug!(
|
tracing::debug!(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue