mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 02:55:58 +01:00 
			
		
		
		
	fix crash when you go to /topics/nonexistant
This commit is contained in:
		| @@ -12,6 +12,7 @@ marked.setOptions({ | ||||
| (function(Posts) { | ||||
|  | ||||
| 	Posts.get = function(callback, tid, current_user, start, end) { | ||||
|  | ||||
| 		if (start == null) start = 0; | ||||
| 		if (end == null) end = start + 10; | ||||
|  | ||||
| @@ -74,6 +75,11 @@ marked.setOptions({ | ||||
| 		// get all data for thread in asynchronous fashion | ||||
| 		RDB.lrange('tid:' + tid + ':posts', start, end, function(err, pids) { | ||||
| 			RDB.handle(err); | ||||
|  | ||||
| 			if(pids.length === 0){ | ||||
| 				callback(false); | ||||
| 				return; | ||||
| 			} | ||||
| 			 | ||||
| 			var content = [], uid = [], timestamp = [], pid = [], post_rep = [], editor = [], editTime = [], deleted = []; | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user