From bec87b1acb708cba7b13173d3e240ce9dfb4bb27 Mon Sep 17 00:00:00 2001 From: Vivek Seth Date: Thu, 5 May 2016 14:52:29 -0400 Subject: If no input params return random coordinate --- lib/address.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/address.js b/lib/address.js index 6d9748fd..684914ce 100644 --- a/lib/address.js +++ b/lib/address.js @@ -133,7 +133,10 @@ var address = { return [radiansToDegrees(lat2), radiansToDegrees(lon2)]; } - location = location || [faker.latitude(), faker.longitude()] + // If there is no coordinate, the best we can do is return a random GPS coordinate. + if (coordinate === undefined) { + return [this.latitude(), this.longitude()] + } radius = radius || 10.0; isMetric = isMetric || false; -- cgit v1.2.3