From f3e81de17688e310b7a5ef5108a3a6c8962eb133 Mon Sep 17 00:00:00 2001 From: oranagra Date: Mon, 23 May 2016 13:58:50 +0300 Subject: fix georadius returns multiple replies --- src/geo.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/geo.c b/src/geo.c index bcedd4637..28cb433dc 100644 --- a/src/geo.c +++ b/src/geo.c @@ -156,9 +156,13 @@ double extractDistanceOrReply(client *c, robj **argv, return -1; } + if (distance < 0) { + addReplyError(c,"radius cannot be negative"); + return -1; + } + double to_meters = extractUnitOrReply(c,argv[1]); if (to_meters < 0) { - addReplyError(c,"radius cannot be negative"); return -1; } @@ -465,7 +469,6 @@ void georadiusGeneric(client *c, int type) { double radius_meters = 0, conversion = 1; if ((radius_meters = extractDistanceOrReply(c, c->argv + base_args - 2, &conversion)) < 0) { - addReplyError(c,"radius must be >= 0"); return; } -- cgit v1.2.1