diff options
author | Marcus Lundblad <ml@update.uu.se> | 2021-05-27 23:12:34 +0200 |
---|---|---|
committer | Marcus Lundblad <ml@update.uu.se> | 2021-05-27 23:12:34 +0200 |
commit | 84fc4b2ae319ea155de52adceaa83a4da9f82c92 (patch) | |
tree | f30ea1a8b32e47196359eb5e0137458cea902aae | |
parent | 536ae6ee09bcdea76b96f1823f71dc1e567eaf0c (diff) | |
download | gnome-maps-wip/mlundblad/fix-saved-aerial-no-support.tar.gz |
mapView: Don't try to set aerial tiles if not availablewip/mlundblad/fix-saved-aerial-no-support
Safe-guard agains setting the aerial tile source
if it's not available in the service file.
This avoid a crash if aerial was saved as last-used
map type in gsettings and at next startup the service
has dropped support.
-rw-r--r-- | src/mapView.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/mapView.js b/src/mapView.js index 95dbe984..10e6d5a3 100644 --- a/src/mapView.js +++ b/src/mapView.js @@ -417,15 +417,17 @@ var MapView = GObject.registerClass({ this._mapType = mapType; if (mapType !== MapType.LOCAL) { - if (mapType === MapType.AERIAL) { - if (Service.getService().tiles.hybridAerial && + let tiles = Service.getService().tiles; + + if (mapType === MapType.AERIAL && tiles.aerial) { + if (tiles.hybridAerial && Application.settings.get('hybrid-aerial')) { this.view.map_source = MapSource.createHybridAerialSource(); } else { this.view.map_source = MapSource.createAerialSource(); } } else { - if (Service.getService().tiles.streetDark && + if (tiles.streetDark && Application.settings.get('night-mode')) { this.view.map_source = MapSource.createStreetDarkSource(); } else { |