Fix the Servers page failing when no servers are configured
CI / test (push) Successful in 54s
Release / release (push) Successful in 2m31s
Docker / image (push) Successful in 2m52s

An empty server list was sent as null, so the page threw on .length and
showed only the loading placeholder. The API now always returns a list,
the page tolerates null, and tests cover the empty config and the token.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
VeillaxandClaude Sonnet 5.5 committed 2026-10-26 23:58:26 -06:00
1 parent 8f01c6213f
commit 4afbf2d266
4 files changed
+78 -3

No files matched your search

+3
View File
@@ -69,6 +69,9 @@ func Parse(data []byte) (*Config, error) {
if c.UnknownMOTD == "" {
c.UnknownMOTD = "§cUnknown server"
}
if c.Servers == nil {
c.Servers = []Server{}
}
return &c, c.validate()
}