mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 11:05:54 +01:00 
			
		
		
		
	fix getSortedSetRange() if start>0 and stop is -1
This commit is contained in:
		| @@ -141,8 +141,13 @@ module.exports = function(db, module) { | ||||
| 			key = {$in: key}; | ||||
| 		} | ||||
|  | ||||
| 		var limit = stop - start + 1; | ||||
| 		if (limit <= 0) { | ||||
| 			limit = 0; | ||||
| 		} | ||||
|  | ||||
| 		db.collection('objects').find({_key: key}, {fields: fields}) | ||||
| 			.limit(stop - start + 1) | ||||
| 			.limit(limit) | ||||
| 			.skip(start) | ||||
| 			.sort({score: sort}) | ||||
| 			.toArray(function(err, data) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user