From 44ccd111b2a4a8b5118aec9916faed8614e95bc7 Mon Sep 17 00:00:00 2001 From: cutls Date: Tue, 8 Oct 2019 22:04:51 +0900 Subject: [PATCH] Fix error on Linux --- app/main/css.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/main/css.js b/app/main/css.js index 1efe2e88..4cef7045 100644 --- a/app/main/css.js +++ b/app/main/css.js @@ -92,10 +92,14 @@ function css(mainWindow) { }) ipc.on('theme-json-list', function (e, arg) { fs.readdir(app.getPath("userData"), function (err, files) { - if (err) throw err; + if (err || !files) throw err; var fileList = files.filter(function (file) { - var tfile = join(app.getPath("userData"), file); - return fs.statSync(tfile).isFile() && /.*\.thedesktheme$/.test(tfile); //絞り込み + if(file.match(/\.thedesktheme$/)){ + var tfile = join(app.getPath("userData"), file) + return fs.statSync(tfile).isFile() && /.*\.thedesktheme$/.test(tfile) + }else{ + return null + } }) var themes = []; for (var i = 0; i < fileList.length; i++) {