make sure we don't shut uiautomator down if it's already gone (fix #1402)

This commit is contained in:
Jonathan Lipps
2013-10-31 15:15:30 -07:00
parent 6aa838e474
commit 8e965db971

View File

@@ -273,10 +273,15 @@ Android.prototype.cleanup = function() {
Android.prototype.shutdown = function(cb) {
var next = function() {
this.uiautomator.shutdown(function() {
if (this.uiautomator) {
this.uiautomator.shutdown(function() {
this.cleanup();
cb();
}.bind(this));
} else {
this.cleanup();
cb();
}.bind(this));
}
}.bind(this);
if (this.adb) {