diff options
author | Samy Pessé <samypesse@gmail.com> | 2016-02-24 12:45:25 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2016-02-24 12:45:25 +0100 |
commit | b244d506bd49526abbcfe84e2175b3410bbabb8c (patch) | |
tree | 361d53e96ab19e4e5eaca2176022da7d5d43b565 /lib/backbone/file.js | |
parent | 44f03865c0358d3c109256e58d5e8e6d1091d0b8 (diff) | |
download | gitbook-b244d506bd49526abbcfe84e2175b3410bbabb8c.zip gitbook-b244d506bd49526abbcfe84e2175b3410bbabb8c.tar.gz gitbook-b244d506bd49526abbcfe84e2175b3410bbabb8c.tar.bz2 |
Correctly setup summary instance when file doesn't exist
Diffstat (limited to 'lib/backbone/file.js')
-rw-r--r-- | lib/backbone/file.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/backbone/file.js b/lib/backbone/file.js index 6c46d5e..209e261 100644 --- a/lib/backbone/file.js +++ b/lib/backbone/file.js @@ -21,6 +21,11 @@ BackboneFile.prototype.parse = function() { // To be implemented by each child }; +// Handle case where file doesn't exists +BackboneFile.prototype.parseNotFound = function() { + +}; + // Return true if backbone file exists BackboneFile.prototype.exists = function() { return Boolean(this.path); @@ -48,7 +53,7 @@ BackboneFile.prototype.load = function() { return this.locate() .then(function() { - if (!that.path) return; + if (!that.path) return that.parseNotFound(); that.log.debug.ln(that.type, 'located at', that.path); |