From 641532daec6fbf8d473f9771cb275b414d09bd1c Mon Sep 17 00:00:00 2001 From: Ske Date: Wed, 10 Jul 2019 12:54:54 +0200 Subject: [PATCH] Fix API system fronter endpoint crashing on system with no switches --- PluralKit.API/Controllers/SystemController.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PluralKit.API/Controllers/SystemController.cs b/PluralKit.API/Controllers/SystemController.cs index 65cb575b..9024509c 100644 --- a/PluralKit.API/Controllers/SystemController.cs +++ b/PluralKit.API/Controllers/SystemController.cs @@ -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 {