diff --git a/Cargo.lock b/Cargo.lock index 38e993f21c0d61e0165d43169efee8e86193fc9a..46a072b34c2d48b4e5607488ccbbe8b65f89092d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6270,6 +6270,7 @@ dependencies = [ "bitflags 2.9.0", "core-foundation 0.10.0", "fsevent-sys 3.1.0", + "log", "parking_lot", "tempfile", "workspace-hack", diff --git a/crates/fsevent/Cargo.toml b/crates/fsevent/Cargo.toml index c9cec9c1e1a09f73e0464a18ed2e5ac6cadab2d4..a421294785cee5546db9d9c2066cde530f0c8b2c 100644 --- a/crates/fsevent/Cargo.toml +++ b/crates/fsevent/Cargo.toml @@ -15,6 +15,7 @@ doctest = false [dependencies] bitflags.workspace = true parking_lot.workspace = true +log.workspace = true workspace-hack.workspace = true [target.'cfg(target_os = "macos")'.dependencies] diff --git a/crates/fsevent/src/fsevent.rs b/crates/fsevent/src/fsevent.rs index c97ab5f35d1b1e8463e895da7a309dc7ef3be998..e4060f3ae06a8d9412baf1cd75a9503c1b6d359b 100644 --- a/crates/fsevent/src/fsevent.rs +++ b/crates/fsevent/src/fsevent.rs @@ -70,10 +70,14 @@ impl EventStream { path_bytes.len() as cf::CFIndex, false, ); - let cf_path = cf::CFURLCopyFileSystemPath(cf_url, cf::kCFURLPOSIXPathStyle); - cf::CFArrayAppendValue(cf_paths, cf_path); - cf::CFRelease(cf_path); - cf::CFRelease(cf_url); + if !cf_url.is_null() { + let cf_path = cf::CFURLCopyFileSystemPath(cf_url, cf::kCFURLPOSIXPathStyle); + cf::CFArrayAppendValue(cf_paths, cf_path); + cf::CFRelease(cf_path); + cf::CFRelease(cf_url); + } else { + log::error!("Failed to create CFURL for path: {}", path.display()); + } } let mut state = Box::new(State {