mirror of
https://github.com/veeso/termscp.git
synced 2025-12-07 09:36:00 -08:00
fix: fixed a crash when the local directory specified in the auth form does not exist
fix #319
This commit is contained in:
@@ -243,14 +243,14 @@ impl FileTransferActivity {
|
||||
host_bridge_params: HostBridgeParams,
|
||||
remote_params: &FileTransferParams,
|
||||
ticks: Duration,
|
||||
) -> Self {
|
||||
) -> Result<Self, String> {
|
||||
// Get config client
|
||||
let config_client: ConfigClient = Self::init_config_client();
|
||||
// init host bridge
|
||||
let host_bridge = HostBridgeBuilder::build(host_bridge_params, &config_client);
|
||||
let host_bridge = HostBridgeBuilder::build(host_bridge_params, &config_client)?;
|
||||
let host_bridge_connected = host_bridge.is_localhost();
|
||||
let enable_fs_watcher = host_bridge.is_localhost();
|
||||
Self {
|
||||
Ok(Self {
|
||||
exit_reason: None,
|
||||
context: None,
|
||||
app: Application::init(
|
||||
@@ -264,7 +264,7 @@ impl FileTransferActivity {
|
||||
remote_params.protocol,
|
||||
remote_params.params.clone(),
|
||||
&config_client,
|
||||
),
|
||||
)?,
|
||||
browser: Browser::new(&config_client),
|
||||
log_records: VecDeque::with_capacity(256), // 256 events is enough I guess
|
||||
walkdir: WalkdirStates::default(),
|
||||
@@ -280,7 +280,7 @@ impl FileTransferActivity {
|
||||
},
|
||||
host_bridge_connected,
|
||||
remote_connected: false,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fn host_bridge(&self) -> &FileExplorer {
|
||||
|
||||
@@ -108,6 +108,10 @@ impl Context {
|
||||
pub fn error(&mut self) -> Option<String> {
|
||||
self.error.take()
|
||||
}
|
||||
|
||||
pub fn set_error(&mut self, error: String) {
|
||||
self.error = Some(error);
|
||||
}
|
||||
}
|
||||
|
||||
impl Drop for Context {
|
||||
|
||||
Reference in New Issue
Block a user