Navigation Menu

Skip to content

Commit

Permalink
Merge pull request #23 from nathan-owen/lastfolders-fix
Browse files Browse the repository at this point in the history
Fixed issue where the app would crash if the previously opened folder…
  • Loading branch information
BobStrogg committed May 30, 2019
2 parents ff44470 + 51820d7 commit c999bb7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
14 changes: 13 additions & 1 deletion main.js
Expand Up @@ -187,7 +187,19 @@ function initialize()

var lastFolders = settings.get( "folders" )

if ( lastFolders ) openFolders( lastFolders )
//If we have last folders, we need to make sure that the folder still exists before trying to open it
if ( lastFolders)
{
fs.stat(`${lastFolders}`, function(err) {
if (!err) {
console.log('Opening Last Folders');
openFolders( lastFolders )
}
else if (err.code === 'ENOENT') {
console.log(`Last folders: '${lastFolders}' doesn't exist anymore`);
}
});
}

expressApp.get( "/", ( request, response ) =>
{
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c999bb7

Please sign in to comment.