mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-11 19:17:09 +03:00
Merge pull request #944 from schadomi7/fuzzy-finder-teletype-fix-old-nodejs
Fix(fuzzy-finder) fs.lstatSync throws Exception if not a file or dir
This commit is contained in:
commit
3411fb731a
@ -166,10 +166,14 @@ module.exports = class FuzzyFinderView {
|
|||||||
this.moveToCaretPosition(caretPosition)
|
this.moveToCaretPosition(caretPosition)
|
||||||
} else if (!uri) {
|
} else if (!uri) {
|
||||||
this.cancel()
|
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 {
|
} 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()
|
const caretPosition = this.getCaretPosition()
|
||||||
this.cancel()
|
this.cancel()
|
||||||
this.openURI(uri, caretPosition, openOptions)
|
this.openURI(uri, caretPosition, openOptions)
|
||||||
|
Loading…
Reference in New Issue
Block a user