Fix the Servers page failing when no servers are configured
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:
1 parent
8f01c6213f
commit
4afbf2d266
4 files changed
+78
-3
No files matched your search
@@ -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()
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user