sftp: handle incorrect reported CWD

This commit is contained in:
Eugene Pankov 2021-08-28 17:07:23 +02:00
parent 67ff355ca3
commit 49d58c69bc
No known key found for this signature in database
GPG Key ID: 5896FCBBDD1CF4F4

View File

@ -34,7 +34,12 @@ export class SFTPPanelComponent {
async ngOnInit (): Promise<void> {
this.sftp = await this.session.openSFTP()
await this.navigate(this.path)
try {
await this.navigate(this.path)
} catch (error) {
console.warn('Could not navigate to', this.path, ':', error)
await this.navigate('/')
}
}
async navigate (newPath: string): Promise<void> {