Skip to content

Commit

Permalink
Make sure LSP url is a valid url when switching
Browse files Browse the repository at this point in the history
  • Loading branch information
benthecarman committed Jun 10, 2024
1 parent 10bbc27 commit 7c628b6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions mutiny-core/src/nodemanager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ use std::sync::atomic::{AtomicBool, Ordering};
#[cfg(not(target_arch = "wasm32"))]
use std::time::Instant;
use std::{collections::HashMap, ops::Deref, sync::Arc};
use url::Url;
#[cfg(target_arch = "wasm32")]
use web_time::Instant;

Expand Down Expand Up @@ -2037,6 +2038,11 @@ pub fn create_lsp_config(
match (lsp_url.clone(), lsp_connection_string.clone()) {
(Some(lsp_url), None) => {
if !lsp_url.is_empty() {
// make sure url is valid
if Url::parse(&lsp_url).is_err() {
return Err(MutinyError::InvalidArgumentsError);
}

Ok(Some(LspConfig::new_voltage_flow(lsp_url)))
} else {
Ok(None)
Expand Down

0 comments on commit 7c628b6

Please sign in to comment.