Fix a bug when position cannot be fetched

This commit is contained in:
Lucas Verney 2018-08-26 17:41:41 +02:00
parent 9fc2128679
commit 5d84c6a0e6
1 changed files with 5 additions and 1 deletions

View File

@ -98,7 +98,11 @@ export default {
computed: {
currentLatLng() {
// Check that this is a correct position
if (this.currentLocation === null) {
if (
!this.currentLocation
|| !this.currentLocation.latitude
|| !this.currentLocation.longitude
) {
return null;
}
return [this.currentLocation.latitude, this.currentLocation.longitude];