Fix API system fronter endpoint crashing on system with no switches
This commit is contained in:
parent
740ccf6979
commit
641532daec
@ -92,6 +92,8 @@ namespace PluralKit.API.Controllers
|
|||||||
if (system == null) return NotFound("System not found.");
|
if (system == null) return NotFound("System not found.");
|
||||||
|
|
||||||
var sw = await _switches.GetLatestSwitch(system);
|
var sw = await _switches.GetLatestSwitch(system);
|
||||||
|
if (sw == null) return NotFound("System has no registered switches.");
|
||||||
|
|
||||||
var members = await _switches.GetSwitchMembers(sw);
|
var members = await _switches.GetSwitchMembers(sw);
|
||||||
return Ok(new FrontersReturn
|
return Ok(new FrontersReturn
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user