fix: don't crash when autoproxy member is deleted

This commit is contained in:
spiral 2022-03-19 21:55:59 -04:00
parent 98026dfc7d
commit 1a38635a12
No known key found for this signature in database
GPG Key ID: 244A11E4B0BCF40E

View File

@ -91,7 +91,7 @@ public class Autoproxy
var relevantMember = ctx.MessageContext.AutoproxyMode switch var relevantMember = ctx.MessageContext.AutoproxyMode switch
{ {
AutoproxyMode.Front => fronters.Length > 0 ? await ctx.Repository.GetMember(fronters[0]) : null, AutoproxyMode.Front => fronters.Length > 0 ? await ctx.Repository.GetMember(fronters[0]) : null,
AutoproxyMode.Member => await ctx.Repository.GetMember(ctx.MessageContext.AutoproxyMember.Value), AutoproxyMode.Member when ctx.MessageContext.AutoproxyMember.HasValue => await ctx.Repository.GetMember(ctx.MessageContext.AutoproxyMember.Value),
_ => null _ => null
}; };