Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Recover from empty file

  • Loading branch information...
commit 65da33991868f73a90c6b944555d16be388ef221 1 parent 9545c60
@kriszyp kriszyp authored
Showing with 5 additions and 2 deletions.
  1. +5 −2 lib/store/js-file.js
View
7 lib/store/js-file.js
@@ -23,8 +23,11 @@ exports.JSFile = function(filename){
var fileTime = stat.mtime.getTime();
if(fileTime > lastMod){
lastMod = fileTime;
- var data = JSONExt.parse(File.read(filename));
- store.setIndex(data);
+ var contents = File.read(filename);
+ if(contents){
+ var data = JSONExt.parse(contents);
+ store.setIndex(data);
+ }
}
}
else if(lastMod === 0){
Please sign in to comment.
Something went wrong with that request. Please try again.