mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-02-23 23:54:13 +08:00
fix(templates): Handle error when scanning dir (Sentry 44351)
https://sentry.nylas.com/sentry/edgehill/group/44351/
This commit is contained in:
parent
4160757c9e
commit
e57fd2c678
1 changed files with 7 additions and 0 deletions
|
@ -90,6 +90,13 @@ class TemplateStore extends NylasStore {
|
||||||
|
|
||||||
_populate() {
|
_populate() {
|
||||||
fs.readdir(this._templatesDir, (err, filenames) => {
|
fs.readdir(this._templatesDir, (err, filenames) => {
|
||||||
|
if (err) {
|
||||||
|
NylasEnv.showErrorDialog({
|
||||||
|
title: "Cannot scan templates directory",
|
||||||
|
message: `N1 was unable to read the contents of your templates directory (${this._templatesDir}). You may want to delete this folder or ensure filesystem permissions are set correctly.`,
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
this._items = [];
|
this._items = [];
|
||||||
for (let i = 0, filename; i < filenames.length; i++) {
|
for (let i = 0, filename; i < filenames.length; i++) {
|
||||||
filename = filenames[i];
|
filename = filenames[i];
|
||||||
|
|
Loading…
Reference in a new issue