diff options
Diffstat (limited to 'src/object.c')
-rw-r--r-- | src/object.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/object.c b/src/object.c index ce2f3dc14..b75e547b9 100644 --- a/src/object.c +++ b/src/object.c @@ -727,7 +727,11 @@ int getRangeLongFromObjectOrReply(client *c, robj *o, long min, long max, long * } int getPositiveLongFromObjectOrReply(client *c, robj *o, long *target, const char *msg) { - return getRangeLongFromObjectOrReply(c, o, 0, LONG_MAX, target, msg); + if (msg) { + return getRangeLongFromObjectOrReply(c, o, 0, LONG_MAX, target, msg); + } else { + return getRangeLongFromObjectOrReply(c, o, 0, LONG_MAX, target, "value is out of range, must be positive"); + } } int getIntFromObjectOrReply(client *c, robj *o, int *target, const char *msg) { |