daemon: fix crash when misconfigured
This commit is contained in:
@@ -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()),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user