thmarx / vert.x-busmod-redis

Vert.x redis busmod - currently not under active development
Other
12 stars 7 forks source link

ZRangeByScoreCommand fails to handle min and max parameters #4

Open wuman opened 11 years ago

wuman commented 11 years ago

ZRangeByScoreCommand is supposed to take two required parameters min and max as either a Double or a String. However the first line of the call

 Object min = message.body.getObject("min");
 checkNull(min, "min can not be null");
 checkType(min, "min must be of type double or string", new Class[] {Double.class, String.class});

invokes getObject() instead of getNumber() and causes a ClassCastException:

java.lang.ClassCastException: java.lang.Double cannot be cast to java.util.Map
    at org.vertx.java.core.json.JsonObject.getObject(JsonObject.java:97)
    at net.ml.vertx.mods.redis.commands.sortedsets.ZRangeByScoreCommand.handle(ZRangeByScoreCommand.java:50)
    at net.ml.vertx.mods.redis.RedisClient.handle(RedisClient.java:119)