Fix: Exception when creting new node due to unset coords.
This commit is contained in:
parent
483841af89
commit
637fd10606
|
@ -45,6 +45,7 @@ angular.module('ffffng')
|
||||||
});
|
});
|
||||||
|
|
||||||
function withValidCoords(coords, callback) {
|
function withValidCoords(coords, callback) {
|
||||||
|
coords = coords || '';
|
||||||
coords = coords.trim();
|
coords = coords.trim();
|
||||||
if (_.isEmpty(coords)) {
|
if (_.isEmpty(coords)) {
|
||||||
return;
|
return;
|
||||||
|
@ -63,7 +64,7 @@ angular.module('ffffng')
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.updateMap = function (optCoords) {
|
$scope.updateMap = function (optCoords) {
|
||||||
var coords = optCoords || $scope.coords || '';
|
var coords = optCoords || $scope.coords;
|
||||||
withValidCoords(coords, function (lat, lng) {
|
withValidCoords(coords, function (lat, lng) {
|
||||||
updateNodePosition(lat, lng);
|
updateNodePosition(lat, lng);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue