initStaticStringObject(fieldobj,((char*)&fieldname)+(sizeof(long)*2));
o = hashGet(o, &fieldobj);
} else {
+ if (o->type != REDIS_STRING) {
+ return NULL;
+ }
+
/* Every object that this function returns needs to have its refcount
* increased. sortCommand decreases it again. */
incrRefCount(o);
/* lookup value to sort by */
byval = lookupKeyByPattern(c->db,sortby,vector[j].obj);
if (!byval) continue;
- if (byval->type != REDIS_STRING) {
- decrRefCount(byval);
- continue;
- }
} else {
/* use object itself to sort by */
byval = vector[j].obj;