1
1
mirror of https://github.com/Eugeny/tabby.git synced 2024-11-24 14:14:24 +03:00

don't crash if no cwd

This commit is contained in:
Eugene Pankov 2018-11-15 12:39:51 +01:00
parent 8cfaf9082b
commit ab6d5e851b

View File

@ -233,7 +233,12 @@ export class Session extends BaseSession {
return null
}
if (process.platform === 'darwin') {
let lines = (await exec(`lsof -p ${this.truePID} -Fn`))[0].toString().split('\n')
let lines: string[]
try {
lines = (await exec(`lsof -p ${this.truePID} -Fn`))[0].toString().split('\n')
} catch (e) {
return null
}
if (lines[1] === 'fcwd') {
return lines[2].substring(1)
} else {