{"record":{"id":"a635ad7e19040f43","repo":"zed-industries/zed","slug":"url-is-not-a-file-path","errorCode":null,"errorMessage":"url is not a file path: {}","messagePattern":"url is not a file path: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/gpui_macos/src/platform.rs","lineNumber":1574,"sourceCode":"        if let Some(mut callback) = lock.will_open_menu.take() {\n            drop(lock);\n            callback();\n            platform.0.lock().will_open_menu.get_or_insert(callback);\n        }\n    }\n}\n\nextern \"C\" fn handle_dock_menu(this: &mut Object, _: Sel, _: id) -> id {\n    unsafe {\n        let platform = get_mac_platform(this);\n        let state = platform.0.lock();\n        if let Some(id) = state.dock_menu {\n            id\n        } else {\n            nil\n        }\n    }\n}\n\nunsafe fn ns_url_to_path(url: id) -> Result<PathBuf> {\n    let path: *mut c_char = msg_send![url, fileSystemRepresentation];\n    anyhow::ensure!(!path.is_null(), \"url is not a file path: {}\", unsafe {\n        CStr::from_ptr(url.absoluteString().UTF8String()).to_string_lossy()\n    });\n    Ok(PathBuf::from(OsStr::from_bytes(unsafe {\n        CStr::from_ptr(path).to_bytes()\n    })))\n}\n\n#[link(name = \"Carbon\", kind = \"framework\")]\nunsafe extern \"C\" {\n    pub(super) fn TISCopyCurrentKeyboardLayoutInputSource() -> *mut Object;\n    pub(super) fn TISCopyCurrentKeyboardInputSource() -> *mut Object;\n    pub(super) fn TISGetInputSourceProperty(\n        inputSource: *mut Object,\n        propertyKey: *const c_void,","sourceCodeStart":1556,"sourceCodeEnd":1592,"githubUrl":"https://github.com/zed-industries/zed/blob/9d272b036335401f339d024ea94968fd51016c40/crates/gpui_macos/src/platform.rs#L1556-L1592","documentation":"Guard in ns_url_to_path: fileSystemRepresentation on the NSURL returned null because the URL does not denote a local file (e.g. http(s): or other scheme), so it has no filesystem path. The message embeds the URL's absoluteString to show the offending input.","triggerScenarios":"Thrown at crates/gpui_macos/src/platform.rs:1507 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the URL scheme (file:/conformant) before attempting path conversion","Use NSURL.isFileURL as a precondition","At the call site, skip or reject non-file URLs before calling this helper"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9d272b036335401f339d024ea94968fd51016c40","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}