提交 2c22f59c 编写于 作者: A antirez

Reply with error on negative geo radius.

Thanks to @tidwall for reporting.
Close #3194.
上级 9c48f28e
...@@ -157,7 +157,10 @@ double extractDistanceOrReply(client *c, robj **argv, ...@@ -157,7 +157,10 @@ double extractDistanceOrReply(client *c, robj **argv,
} }
double to_meters = extractUnitOrReply(c,argv[1]); double to_meters = extractUnitOrReply(c,argv[1]);
if (to_meters < 0) return -1; if (to_meters < 0) {
addReplyError(c,"radius cannot be negative");
return -1;
}
if (conversion) *conversion = to_meters; if (conversion) *conversion = to_meters;
return distance * to_meters; return distance * to_meters;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册