diff --git a/src/bitops.c b/src/bitops.c index 435ab7a33..5190e1035 100644 --- a/src/bitops.c +++ b/src/bitops.c @@ -508,7 +508,7 @@ robj *lookupStringForBitCommand(client *c, uint64_t maxbit, int *created) { * If the source object is NULL the function is guaranteed to return NULL * and set 'len' to 0. */ unsigned char *getObjectReadOnlyString(robj *o, long *len, char *llbuf) { - serverAssert(o->type == OBJ_STRING); + serverAssert(!o || o->type == OBJ_STRING); unsigned char *p = NULL; /* Set the 'p' pointer to the string, that can be just a stack allocated