From 637fd1060677fab341bc7ae13a2f049f0acc7432 Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 30 May 2014 22:25:03 +0200 Subject: [PATCH] Fix: Exception when creting new node due to unset coords. --- app/scripts/directives/nodeForm.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/scripts/directives/nodeForm.js b/app/scripts/directives/nodeForm.js index 753f7e5..34961cb 100644 --- a/app/scripts/directives/nodeForm.js +++ b/app/scripts/directives/nodeForm.js @@ -45,6 +45,7 @@ angular.module('ffffng') }); function withValidCoords(coords, callback) { + coords = coords || ''; coords = coords.trim(); if (_.isEmpty(coords)) { return; @@ -63,7 +64,7 @@ angular.module('ffffng') } $scope.updateMap = function (optCoords) { - var coords = optCoords || $scope.coords || ''; + var coords = optCoords || $scope.coords; withValidCoords(coords, function (lat, lng) { updateNodePosition(lat, lng); });