mirror of
https://github.com/denoland/deno.git
synced 2024-11-21 15:04:11 -05:00
fix(watch): don't panic on invalid file specifiers (#26577)
Removes an unwrap that falsely assumed the specifier is a valid file path. Fixes https://github.com/denoland/deno/issues/26209
This commit is contained in:
parent
ab3d02a081
commit
05868cc236
1 changed files with 5 additions and 1 deletions
|
@ -1009,7 +1009,11 @@ impl deno_graph::source::Reporter for FileWatcherReporter {
|
|||
) {
|
||||
let mut file_paths = self.file_paths.lock();
|
||||
if specifier.scheme() == "file" {
|
||||
file_paths.push(specifier.to_file_path().unwrap());
|
||||
// Don't trust that the path is a valid path at this point:
|
||||
// https://github.com/denoland/deno/issues/26209.
|
||||
if let Ok(file_path) = specifier.to_file_path() {
|
||||
file_paths.push(file_path);
|
||||
}
|
||||
}
|
||||
|
||||
if modules_done == modules_total {
|
||||
|
|
Loading…
Reference in a new issue