Skip to content

Commit

Permalink
make sure weird responses don't crash appium
Browse files Browse the repository at this point in the history
  • Loading branch information
jlipps committed Apr 9, 2014
1 parent e2669dd commit 0d792be
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/devices/ios/ios-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,12 +247,12 @@ iOSController.getSelectorForStrategy = function (strategy, selector) {

iOSController.handleFindCb = function (err, res, many, findCb) {
if (!res) res = {};
if (res.value === null) {
if (!res.value) {
res.status = status.codes.NoSuchElement.code;
}
if (!err && !many && res.status === 0) {
findCb(true, err, res);
} else if (!err && many && res.value !== null && res.value.length > 0) {
} else if (!err && many && res.value && res.value.length > 0) {
findCb(true, err, res);
} else {
findCb(false, err, res);
Expand Down

0 comments on commit 0d792be

Please sign in to comment.