diff --git a/lib/commands/network.js b/lib/commands/network.js index d6089549..a4aa8608 100644 --- a/lib/commands/network.js +++ b/lib/commands/network.js @@ -126,7 +126,17 @@ commands.toggleFlightMode = async function () { commands.setGeoLocation = async function (location) { await this.adb.setGeoLocation(location, this.isEmulator()); - return await this.getGeoLocation(); + try { + return await this.getGeoLocation(); + } catch (e) { + log.warn(`Could not get the current geolocation info: ${e.message}`); + log.warn(`Returning the default zero'ed values`); + return { + latitude: 0.0, + longitude: 0.0, + altitude: 0.0, + }; + } }; commands.getGeoLocation = async function () {