summaryrefslogtreecommitdiff
path: root/model_fs.js
diff options
context:
space:
mode:
Diffstat (limited to 'model_fs.js')
-rw-r--r--model_fs.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/model_fs.js b/model_fs.js
index 14cb4b5..3e2af12 100644
--- a/model_fs.js
+++ b/model_fs.js
@@ -87,7 +87,11 @@ exports.rebuildFiles = function() {
var collectEvents = function(slideset) {
fs.readFile(path.join(__dirname, configuration.dir, slideset, configuration.events), function(err, data) {
if(err) { throw err; }
- var events = JSON.parse(data.toString());
+ try {
+ var events = JSON.parse(data.toString());
+ } catch(e) {
+ throw err;
+ }
if(events['type'] == 'text') {
setEvents(slideset, events['events'], function(err) {
if(err) { throw err; }