Fix error when switching with no previous switches
This commit is contained in:
parent
90ceec61d9
commit
483611702e
@ -143,11 +143,14 @@ namespace PluralKit.API.Controllers
|
||||
|
||||
// We get the current switch, if it exists
|
||||
var latestSwitch = await _switches.GetLatestSwitch(_auth.CurrentSystem);
|
||||
if (latestSwitch != null)
|
||||
{
|
||||
var latestSwitchMembers = await _switches.GetSwitchMembers(latestSwitch);
|
||||
|
||||
// Bail if this switch is identical to the latest one
|
||||
if (latestSwitchMembers.Select(m => m.Hid).SequenceEqual(param.Members))
|
||||
return BadRequest("New members identical to existing fronters.");
|
||||
}
|
||||
|
||||
// Resolve member objects for all given IDs
|
||||
IEnumerable<PKMember> membersList;
|
||||
|
Loading…
Reference in New Issue
Block a user