diff --git a/addon/services/location.js b/addon/services/location.js index b6a92fd3..db36af15 100644 --- a/addon/services/location.js +++ b/addon/services/location.js @@ -93,14 +93,16 @@ export default class LocationService extends Service { if (isArray(coordinates)) { const validCoordinates = coordinates.filter((point) => point.coordinates[0] !== 0); - const [longitude, latitude] = getWithDefault(validCoordinates, '0.coordinates', [0, 0]); - const coordinates = { - latitude, - longitude, - }; - - this.updateLocation(coordinates); - return coordinates; + if (validCoordinates) { + const [longitude, latitude] = getWithDefault(validCoordinates, '0.coordinates', [0, 0]); + const userCoordinates = { + latitude, + longitude, + }; + + this.updateLocation(userCoordinates); + return userCoordinates; + } } return this.getUserLocationFromWhois(); diff --git a/composer.json b/composer.json index d1ac2c45..a3a0e2a9 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "fleetbase/fleetops-api", - "version": "0.4.7", + "version": "0.4.8", "description": "Fleet & Transport Management Extension for Fleetbase", "keywords": [ "fleetbase-extension", @@ -22,7 +22,7 @@ ], "require": { "php": "^8.0", - "fleetbase/core-api": "^1.4.0", + "fleetbase/core-api": "^1.4.1", "barryvdh/laravel-dompdf": "^2.0", "brick/geo": "0.7.2", "cknow/laravel-money": "^7.1", diff --git a/extension.json b/extension.json index 6b6adbe0..49e73ad8 100644 --- a/extension.json +++ b/extension.json @@ -1,6 +1,6 @@ { "name": "Fleet-Ops", - "version": "0.4.7", + "version": "0.4.8", "description": "Fleet & Transport Management Extension for Fleetbase", "repository": "https://github.com/fleetbase/fleetops", "license": "MIT", diff --git a/package.json b/package.json index 3a3badb7..8b6173f6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@fleetbase/fleetops-engine", - "version": "0.4.7", + "version": "0.4.8", "description": "Fleet & Transport Management Extension for Fleetbase", "fleetbase": { "route": "fleet-ops"