1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-02 01:33:22 +00:00

wip: Early exit for GetLockStatus if client isn't open

This commit is contained in:
Isaiah Inuwa
2025-12-03 10:16:21 -06:00
parent d4b0439874
commit dc4acd672d
2 changed files with 8 additions and 0 deletions

View File

@@ -103,6 +103,10 @@ pub struct NativeStatus {
const NO_CALLBACK_INDICATOR: u32 = 0;
impl WindowsProviderClient {
pub fn is_available() -> bool {
desktop_core::ipc::path("af").exists()
}
// FIXME: Remove unwraps! They panic and terminate the whole application.
#[allow(clippy::unwrap_used)]
pub fn connect() -> Self {

View File

@@ -226,6 +226,10 @@ impl PluginAuthenticator for BitwardenPluginAuthenticator {
}
fn lock_status(&self) -> Result<PluginLockStatus, Box<dyn std::error::Error>> {
// If the IPC pipe is not open, then the client is not open and must be locked/logged out.
if !WindowsProviderClient::is_available() {
return Ok(PluginLockStatus::PluginLocked);
}
get_lock_status(&self.get_client())
.map(|response| {
if response.is_unlocked {