From 0fcb079e5fc3169ff40f7d895f29bc5d41f3e614 Mon Sep 17 00:00:00 2001 From: George Crabtree Date: Thu, 29 May 2014 11:01:34 +1000 Subject: [PATCH] fixed: will only try and parse css if it exists --- index.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index ffba4ab..b85c3c0 100644 --- a/index.js +++ b/index.js @@ -7,7 +7,7 @@ var path = require('path'); module.exports = function (options) { var opts = options ? options : {}; var paths = opts.paths ? opts.paths : []; - + return through.obj(function (file, enc, cb) { if (file.isStream()) return cb(new gutil.PluginError("gulp-stylus: Streaming not supported")); @@ -31,9 +31,11 @@ module.exports = function (options) { } }) .then(function(css){ - file.path = rext(file.path, '.css'); - file.contents = new Buffer(css); - that.push(file); + if (css) { + file.path = rext(file.path, '.css'); + file.contents = new Buffer(css); + that.push(file); + } cb(); }); });