Private
Public Access
1
0

daemon: fix crash when misconfigured

This commit is contained in:
2025-08-25 00:09:57 -07:00
parent cc59fe4996
commit f82123a454

View File

@@ -701,7 +701,13 @@ impl Daemon {
.ok_or(DaemonError::ClientNotConfigured)?; .ok_or(DaemonError::ClientNotConfigured)?;
let client = HTTPAPIClient::new( let client = HTTPAPIClient::new(
server_url.parse().unwrap(), match server_url.parse() {
Ok(url) => url,
Err(_) => {
log::error!(target: target::DAEMON, "Invalid server URL: {}", server_url);
return Err(DaemonError::ClientNotConfigured.into());
}
},
DatabaseAuthenticationStore::new(database.clone()), DatabaseAuthenticationStore::new(database.clone()),
); );