From f2db379fa3f6e0c0d81350fd0f29febea95df469 Mon Sep 17 00:00:00 2001 From: Madelyn Olson <34459052+madolson@users.noreply.github.com> Date: Tue, 11 Aug 2020 20:04:54 -0700 Subject: Replace usage of wrongtypeerr with helper (#7633) * Replace usage of wrongtypeerr with helper --- src/bitops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/bitops.c') diff --git a/src/bitops.c b/src/bitops.c index 4b1a09aa4..37fb13f0c 100644 --- a/src/bitops.c +++ b/src/bitops.c @@ -480,12 +480,12 @@ int getBitfieldTypeFromArgument(client *c, robj *o, int *sign, int *bits) { robj *lookupStringForBitCommand(client *c, size_t maxbit) { size_t byte = maxbit >> 3; robj *o = lookupKeyWrite(c->db,c->argv[1]); + if (checkType(c,o,OBJ_STRING)) return NULL; if (o == NULL) { o = createObject(OBJ_STRING,sdsnewlen(NULL, byte+1)); dbAdd(c->db,c->argv[1],o); } else { - if (checkType(c,o,OBJ_STRING)) return NULL; o = dbUnshareStringValue(c->db,c->argv[1],o); o->ptr = sdsgrowzero(o->ptr,byte+1); } -- cgit v1.2.1