Skip to content

Commit 4f038da

Browse files
author
Peter Chanthamynavong
committed
configure() should check if config-* exists and is a file before attempting to read file
1 parent 07159d1 commit 4f038da

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
*.sublime-project
22
*.sublime-workspace
33
.DS_Store
4-
*.log
4+
*.log
5+
.idea

index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4286,10 +4286,10 @@ Framework.prototype.configure = function(arr, rewrite) {
42864286

42874287
arr = [];
42884288

4289-
if (fs.existsSync(filenameA))
4289+
if (fs.existsSync(filenameA) && fs.lstatSync(filenameA).isFile())
42904290
arr = arr.concat(fs.readFileSync(filenameA).toString(ENCODING).split('\n'));
42914291

4292-
if (fs.existsSync(filenameB))
4292+
if (fs.existsSync(filenameB) && fs.lstatSync(filenameB).isFile())
42934293
arr = arr.concat(fs.readFileSync(filenameB).toString(ENCODING).split('\n'));
42944294
}
42954295

@@ -10784,4 +10784,4 @@ http.IncomingMessage.prototype.hostname = function(path) {
1078410784
return uri.protocol + '//' + uri.hostname + (uri.port !== null && typeof(uri.port) !== UNDEFINED && uri.port !== 80 ? ':' + uri.port : '') + (path || '');
1078510785
};
1078610786

10787-
global.framework = module.exports = new Framework();
10787+
global.framework = module.exports = new Framework();

0 commit comments

Comments
 (0)