Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixed regression; only pass additional params on error

closes #96
  • Loading branch information...
commit 1d43224ffa4f8fad73c8c925e0ffda274be0fbce 1 parent 638d55c
@aheckmann authored
Showing with 11 additions and 2 deletions.
  1. +11 −2 lib/getters.js
View
13 lib/getters.js
@@ -57,13 +57,22 @@ module.exports = function (gm) {
if (val.verbose) {
self.identify(opts, function (err, stdout, stderr, cmd) {
- self.emit(getter, err, self.data[key], stdout, stderr, cmd);
+ if (err) {
+ self.emit(getter, err, self.data[key], stdout, stderr, cmd);
+ } else {
+ self.emit(getter, err, self.data[key]);
+ }
});
return self;
}
var args = makeArgs(self, val);
self._exec(args, function (err, stdout, stderr, cmd) {
+ if (err) {
+ self.emit(getter, err, self.data[key], stdout, stderr, cmd);
+ return;
+ }
+
var result = (stdout||'').trim();
if (val.helper in helper) {
@@ -72,7 +81,7 @@ module.exports = function (gm) {
self.data[key] = result;
}
- self.emit(getter, err, self.data[key], stdout, stderr, cmd);
+ self.emit(getter, err, self.data[key]);
});
return self;
Please sign in to comment.
Something went wrong with that request. Please try again.