sftp: handle incorrect reported CWD

This commit is contained in:
Eugene Pankov
2021-08-28 17:07:23 +02:00
parent 67ff355ca3
commit 49d58c69bc

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> {