mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 14:03:30 +00:00 
			
		
		
		
	user groups: Fix membership checks for unknown user groups.
AFAIK I should this never fail, hence the blueslip.error line. But it is failing in practice when rendering user groups after looking them up by ID, and the error handling should definitely be softer.
This commit is contained in:
		@@ -61,6 +61,10 @@ exports.get_realm_user_groups = function () {
 | 
			
		||||
 | 
			
		||||
exports.is_member_of = function (user_group_id, user_id) {
 | 
			
		||||
    var user_group = user_group_by_id_dict.get(user_group_id);
 | 
			
		||||
    if (user_group === undefined) {
 | 
			
		||||
        blueslip.error("Could not find user group with ID " + user_group_id);
 | 
			
		||||
        return false;
 | 
			
		||||
    }
 | 
			
		||||
    return user_group.members.has(user_id);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user