From 35a7f0d8c83b1c2012c26177a0284070625a86c5 Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Sat, 22 Nov 2014 18:33:16 +0900 Subject: [PATCH] Fixing server crash when geo data not provided --- server/search.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/search.js b/server/search.js index c658727..e3b67dd 100644 --- a/server/search.js +++ b/server/search.js @@ -230,7 +230,7 @@ function computeRecordGeo(records, geo) { _.each(records, function(record) { record.distance = 0.0; - if (geo !== null) { + if (geo) { record.distance = geolib.getDistance(record.geo, geo) / 1000.0; }