From a283ab2786d3c04afb35035618db77bc4337d886 Mon Sep 17 00:00:00 2001 From: Bjorge Dijkstra Date: Thu, 18 Feb 2016 20:47:17 +0100 Subject: [PATCH] Fix check for valid distance in drawCircle() --- public_html/script.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/public_html/script.js b/public_html/script.js index ce21e36..823f228 100644 --- a/public_html/script.js +++ b/public_html/script.js @@ -894,10 +894,11 @@ function resetMap() { function drawCircle(marker, distance) { if (typeof distance === 'undefined') { return false; - - if (!(!isNaN(parseFloat(distance)) && isFinite(distance)) || distance < 0) { - return false; - } + } + + distance = parseFloat(distance); + if (isNaN(distance) || !isFinite(distance) || distance < 0) { + return false; } distance *= 1000.0;