mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-08-16 14:40:23 +03:00
Fix fs.lstatSync throws Exception if no file or dir
If it throws the Exception, other valid uris such as atom://teletype/... will not be evaluated in the else branch The old fs-plus did not throw. Newer versions of fs.lstatSync allow for option parameter to control if it throws.
This commit is contained in:
parent
4c6d9071c2
commit
59bdc8d354
@ -166,10 +166,14 @@ module.exports = class FuzzyFinderView {
|
||||
this.moveToCaretPosition(caretPosition)
|
||||
} else if (!uri) {
|
||||
this.cancel()
|
||||
} else if (fs.lstatSync(uri).isDirectory()) {
|
||||
this.selectListView.update({errorMessage: 'Selected path is a directory'})
|
||||
setTimeout(() => { this.selectListView.update({errorMessage: null}) }, 2000)
|
||||
} else {
|
||||
try {
|
||||
if (fs.lstatSync(uri).isDirectory()) {
|
||||
this.selectListView.update({errorMessage: 'Selected path is a directory'})
|
||||
setTimeout(() => { this.selectListView.update({errorMessage: null}) }, 2000)
|
||||
return
|
||||
}
|
||||
} catch (e) {}
|
||||
const caretPosition = this.getCaretPosition()
|
||||
this.cancel()
|
||||
this.openURI(uri, caretPosition, openOptions)
|
||||
|
Loading…
Reference in New Issue
Block a user