Skip to content

Commit

Permalink
fix(index): runaway promise (#269)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcjfunk authored and michael-ciniawsky committed Oct 10, 2017
1 parent 44f01bb commit 8df20ce
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,9 @@ module.exports = function loader (css, map) {
* @param {String} result Result (JS Module)
* @param {Object} map Source Map
*/
return cb(null, `module.exports = ${JSON.stringify(css)}`, map) || null
cb(null, `module.exports = ${JSON.stringify(css)}`, map)

return null
}
/**
* @memberof loader
Expand All @@ -175,7 +177,9 @@ module.exports = function loader (css, map) {
* @param {String} css Result (Raw Module)
* @param {Object} map Source Map
*/
return cb(null, css, map) || null
cb(null, css, map)

return null
})
}).catch((err) => {
return err.name === 'CssSyntaxError' ? cb(new SyntaxError(err)) : cb(err)
Expand Down

0 comments on commit 8df20ce

Please sign in to comment.