Not all the results returned from instruments are valid json.

This commit is contained in:
Sebastian Tiedtke
2013-01-12 17:52:24 -08:00
parent 6f638db3c5
commit 2e81b8f5be

View File

@@ -92,8 +92,12 @@ Appium.prototype.push = function(elem) {
if (result === 'undefined') {
target[1]();
} else {
var jsonresult = JSON.parse(result);
target[1](jsonresult);
try {
var jsonresult = JSON.parse(result);
target[1](jsonresult);
} catch (e) {
target[1](result);
}
}
}