mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
Fix error when switching with no previous switches
This commit is contained in:
parent
90ceec61d9
commit
483611702e
1 changed files with 8 additions and 5 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue