Browse Source

Throw error if readFile fails

pull/22/head
Hector Leon Zarco Garcia 8 years ago
parent
commit
87643df023
  1. 1
      src/node/index.js

1
src/node/index.js

@ -32,6 +32,7 @@ function loadImage(image, cb){ @@ -32,6 +32,7 @@ function loadImage(image, cb){
// TODO: support URLs
if(typeof image === 'string'){
fs.readFile(image, function(err, buffer){
if (err) throw err;
loadImage(buffer, cb)
})
return

Loading…
Cancel
Save