Fix API system fronter endpoint crashing on system with no switches

This commit is contained in:
Ske 2019-07-10 12:54:54 +02:00
parent 740ccf6979
commit 641532daec

View File

@ -92,6 +92,8 @@ namespace PluralKit.API.Controllers
if (system == null) return NotFound("System not found.");
var sw = await _switches.GetLatestSwitch(system);
if (sw == null) return NotFound("System has no registered switches.");
var members = await _switches.GetSwitchMembers(sw);
return Ok(new FrontersReturn
{