Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
Adding a missing null check
  -Rewriting boolean equation for readability
  • Loading branch information
Jeffrey Heifetz authored and bryanhiggins committed Oct 21, 2013
1 parent 6095888 commit e5af8fae30da93379016eb26b73f845a086abf46
Showing 1 changed file with 9 additions and 1 deletion.
@@ -229,7 +229,15 @@ _self = {

bb10_utils.exec(script, args, options, function (error, stdout, stderr) {
// error code 3 corresponds to a connected device, null or "Error: null" in stderr corresponds to connected simulator
callback((type === 'simulator' && (error === null || stderr.length === 0 || stderr.indexOf('Error: null') >= 0 || stderr.indexOf('Error: Authentication failed') >= 0)) || (type === 'device' && error.code === 3));
var isSimConnected = (type === "simulator" && (
error === null ||
stderr.length === 0 ||
stderr.indexOf('Error: null') >= 0 ||
stderr.indexOf('Error: Authentication failed') >= 0
)),
isDeviceConnected = (type === "device" && error && error.code === 3);

callback(isSimConnected || isDeviceConnected);
});
},

0 comments on commit e5af8fa

Please sign in to comment.