fix(bot): fix a few NPEs

This commit is contained in:
alyssa 2024-10-19 07:27:12 +09:00
parent e88486cb41
commit d997f725e2
4 changed files with 5 additions and 3 deletions

View file

@ -112,6 +112,8 @@ public class Switch
await using var conn = await ctx.Database.Obtain();
var currentSwitch = await ctx.Repository.GetLatestSwitch(ctx.System.Id);
if (currentSwitch == null)
throw Errors.NoRegisteredSwitches;
var currentSwitchMembers = await ctx.Repository.GetSwitchMembers(conn, currentSwitch.Id).ToListAsync().AsTask();
if (ctx.MatchFlag("first", "f"))