Permalink
Browse files

Fix Browser#find from previous change.

  • Loading branch information...
1 parent ae62451 commit 340a9c1cb5a0f6357f5a46158891cc1cfa62e5ce @tristandunn committed Mar 13, 2012
Showing with 5 additions and 3 deletions.
  1. +5 −3 lib/browser.js
View
@@ -36,14 +36,16 @@ Browser.prototype.execute = function(code, callback) {
};
Browser.prototype.find = function(selector, callback) {
- this.command("Find", selector, function(ids) {
- if (ids.length > 0) {
+ this.command("Find", selector, function(error, ids) {
+ if (error) {
+ return callback(error);
+ } else if (ids.length > 0) {
var nodes = ids.split(',').map(function(id) {
return new Node(id, this);
}.bind(this));
}
- callback(nodes || []);
+ callback(undefined, nodes || []);
}.bind(this));
};

0 comments on commit 340a9c1

Please sign in to comment.